本文整理汇总了PHP中MVCUtils::findTemplate方法的典型用法代码示例。如果您正苦于以下问题:PHP MVCUtils::findTemplate方法的具体用法?PHP MVCUtils::findTemplate怎么用?PHP MVCUtils::findTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MVCUtils
的用法示例。
在下文中一共展示了MVCUtils::findTemplate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Construct the object
*
* @param Exception The exception to be made user friendly
*/
public function __construct($exception)
{
global $cfg;
$this->template = new Smarty();
$this->template->compile_dir = $cfg['smarty']['compiledir'];
$this->exception = $exception;
$this->templateFileName = MVCUtils::findTemplate($cfg['smarty']['RenderedexceptionTemplateFile']);
$this->_setupTemplate();
}
示例2: smarty_resource_rfile_timestamp
public static function smarty_resource_rfile_timestamp($templateName, &$timestamp, &$smarty)
{
global $cfg;
$file = MVCUtils::findTemplate($templateName);
if ($file === false) {
return false;
} else {
return true;
}
}
示例3: isValid
public function isValid(&$data)
{
global $cfg;
$db = Database::getInstance($cfg['MVC']['dsn']);
$data = $db->quoteSmart($data);
$exists = $db->getOne("SELECT COUNT(*) FROM templates WHERE filename = {$data}");
if ($exists > 0) {
return 'The specified template is already in use';
} elseif (MVCUtils::findTemplate($data) === false) {
return 'The specified template does not exist';
} else {
return true;
}
}
示例4: __construct
public function __construct($templateS, $formName = '', $viewerModuleName, $fieldData = array(), $invalidFields = array())
{
global $cfg;
$this->template = new Smarty();
$this->viewerModuleName = $viewerModuleName;
if (isset($cfg['smarty']['debug']) && $cfg['smarty']['debug'] == true) {
$this->template->clear_all_cache();
$this->template->caching = false;
$this->template->force_compile = true;
}
$this->template->compile_dir = $cfg['smarty']['compiledir'];
//$this->template->template_dir = $cfg['smarty']['tplRoot'];
$this->templateIDStack = $templateS;
$this->formName = $formName;
$this->fieldData = $fieldData;
$this->invalidFields = $invalidFields;
$this->templateFileName = MVCUtils::findTemplate(end($this->templateIDStack));
//echo "#" . $this->templateFileName . "#<br>";
if ($this->templateFileName === false) {
throw new LoggedException("The template with ID " . end($this->templateIDStack) . " could not be found", 0, self::module, 'error');
}
$this->setupTemplate();
}