本文整理匯總了PHP中JController::_createView方法的典型用法代碼示例。如果您正苦於以下問題:PHP JController::_createView方法的具體用法?PHP JController::_createView怎麽用?PHP JController::_createView使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JController
的用法示例。
在下文中一共展示了JController::_createView方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
/**
* Overrides method to first lookup into potential extension for the view.
* @since 1.5
*/
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->_path['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;
}
}
return parent::_createView($name, $prefix, $type, $config);
}