本文整理汇总了PHP中JControllerAdmin::createView方法的典型用法代码示例。如果您正苦于以下问题:PHP JControllerAdmin::createView方法的具体用法?PHP JControllerAdmin::createView怎么用?PHP JControllerAdmin::createView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JControllerAdmin
的用法示例。
在下文中一共展示了JControllerAdmin::createView方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createView
/**
* Overrides method to first lookup into potential extension for the view.
* @since 1.5
*/
protected function createView($name, $prefix = '', $type = '', $config = array())
{
$extensions = JoomleagueHelper::getExtensions(JRequest::getInt('p'));
foreach ($extensions as $e => $extension) {
$result = null;
// Clean the view name
$viewName = preg_replace('/[^A-Z0-9_]/i', '', $name);
$classPrefix = preg_replace('/[^A-Z0-9_]/i', '', $prefix);
$viewType = preg_replace('/[^A-Z0-9_]/i', '', $type);
// Build the view class name
$viewClassExtension = $classPrefix . $viewName . ucfirst($extension);
if (!class_exists($viewClassExtension)) {
jimport('joomla.filesystem.path');
$path = JPath::find($this->paths['view'], $this->createFileName('view', array('name' => $viewName, 'type' => $viewType)));
if ($path) {
require_once $path;
if (class_exists($viewClassExtension)) {
$result = new $viewClassExtension($config);
return $result;
}
}
} else {
$result = new $viewClassExtension($config);
return $result;
}
}
// Still here ? Then the extension doesn't override this, use regular view
return parent::createView($name, $prefix, $type, $config);
}