本文整理汇总了PHP中JController::addModelPath方法的典型用法代码示例。如果您正苦于以下问题:PHP JController::addModelPath方法的具体用法?PHP JController::addModelPath怎么用?PHP JController::addModelPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JController
的用法示例。
在下文中一共展示了JController::addModelPath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testAddModelPath
/**
* Test JController::addModelPath
*
* @since 11.3
*
* @covers JController::addModelPath
*/
public function testAddModelPath()
{
$path = JPath::clean(JPATH_ROOT . '/addmodelpath');
JController::addModelPath($path);
// The default path is the class file folder/forms
$valid = JPATH_PLATFORM . '/joomla/form/fields';
$this->assertThat(in_array($path, JModel::addIncludePath()), $this->isTrue(), 'Line:' . __LINE__ . ' The path should be added to the JModel paths.');
}
示例2: testAddModelPath
/**
* Test JController::addModelPath
*
* @since 1.6
*/
public function testAddModelPath()
{
// Include JModel as this method is a proxy for JModel::addIncludePath
require_once JPATH_PLATFORM . '/joomla/application/component/model.php';
$path = JPATH_ROOT . '/addmodelpath';
JController::addModelPath($path);
// The default path is the class file folder/forms
$valid = JPATH_PLATFORM . '/joomla/form/fields';
$this->assertThat(in_array($path, JModel::addIncludePath()), $this->isTrue(), 'Line:' . __LINE__ . ' The path should be added to the JModel paths.');
}
示例3: testAddModelPath
/**
* Test JController::addModelPath
*
* @since 1.6
*/
public function testAddModelPath()
{
// Include JModel as this method is a proxy for JModel::addIncludePath
require_once JPATH_BASE . '/libraries/joomla/application/component/model.php';
$path = dirname(__FILE__) . DS . 'addmodelpath';
JController::addModelPath($path);
// The default path is the class file folder/forms
$valid = JPATH_LIBRARIES . DS . 'joomla' . DS . 'form/fields';
$this->assertThat(in_array($path, JModel::addIncludePath()), $this->isTrue(), 'Line:' . __LINE__ . ' The path should be added to the JModel paths.');
}
示例4: Submitters
public function Submitters()
{
$mainframe =& JFactory::getApplication();
$mainframe->redirect('index.php?option=com_redform&controller=submitters&task=submitters&integration=redevent&xref=' . JRequest::getInt('xref') . '&form_id=' . JRequest::getInt('form_id') . '&filter=' . JRequest::getInt('filter'));
/* Create the view object */
$view = $this->getView('submitters', 'html');
/* Standard model */
JController::addModelPath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_redform' . DS . 'models');
$view->setModel($this->getModel('submitters', 'RedformModel'), true);
$view->setModel($this->getModel('redform', 'RedformModel'));
$view->setLayout('submitters');
/* Now display the view */
$view->display();
}