本文整理匯總了PHP中Nette\Application\UI\Presenter::formatTemplateFiles方法的典型用法代碼示例。如果您正苦於以下問題:PHP Presenter::formatTemplateFiles方法的具體用法?PHP Presenter::formatTemplateFiles怎麽用?PHP Presenter::formatTemplateFiles使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Nette\Application\UI\Presenter
的用法示例。
在下文中一共展示了Presenter::formatTemplateFiles方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: formatTemplateFiles
/**
* @return mixed
*/
public function formatTemplateFiles()
{
$name = $this->getName();
$templateFiles = [];
$presenter = substr($name, strrpos(':' . $name, ':'));
$dir = dirname($_SERVER['SCRIPT_NAME']);
if (file_exists($_SERVER['DOCUMENT_ROOT'] . $dir . '/themes/' . $this->settings['theme'] . '/' . $this->getView() . '.latte')) {
$templateFiles[] = $_SERVER['DOCUMENT_ROOT'] . $dir . '/themes/' . $this->settings['theme'] . '/' . $this->getView() . '.latte';
}
if (file_exists($_SERVER['DOCUMENT_ROOT'] . $dir . '/themes/' . $this->settings['theme'] . '/' . $presenter . '/' . $this->getView() . '.latte')) {
$templateFiles[] = $_SERVER['DOCUMENT_ROOT'] . $dir . '/themes/' . $this->settings['theme'] . '/' . $presenter . '/' . $this->getView() . '.latte';
}
$originalTemplateFiles = parent::formatTemplateFiles();
return array_merge($templateFiles, $originalTemplateFiles);
}
示例2: formatTemplateFiles
public function formatTemplateFiles()
{
$list = parent::formatTemplateFiles();
$list[] = dirname($this->getReflection()->getFileName()) . "/templates/{$this->view}.latte";
return $list;
}
示例3: formatTemplateFiles
public function formatTemplateFiles() : Ytnuk\Templating\Template
{
return $this['templating'][$this->getView()] ?: parent::formatTemplateFiles();
}
示例4: formatTemplateFiles
/**
* Formats view template file names
*
* @return array
*/
public function formatTemplateFiles()
{
return array_unique(array_merge($this->getTemplateFilesFormatter()->formatTemplateFiles($this->getName(), $this->getView()), parent::formatTemplateFiles()));
}