本文整理匯總了PHP中dir::template方法的典型用法代碼示例。如果您正苦於以下問題:PHP dir::template方法的具體用法?PHP dir::template怎麽用?PHP dir::template使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dir
的用法示例。
在下文中一共展示了dir::template方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getTemplate
public function getTemplate()
{
ob_start();
$content = self::generateArticle($this->get('id'));
$content = extension::get('FRONTEND_OUTPUT', $content);
dyn::add('content', $content);
include dir::template(dyn::get('template'), $this->get('template'));
$content = ob_get_contents();
ob_end_clean();
return $content;
}
示例2: getTemplate
public function getTemplate()
{
ob_start();
if (!pageCache::exist($this->get('id'))) {
pageCache::generateArticle($this->get('id'));
}
$content = pageCache::read($this->get('id'));
$content = pageArea::getEval($content);
$content = extension::get('FRONTEND_OUTPUT', $content);
dyn::add('content', $content);
include dir::template(dyn::get('template'), $this->get('template'));
$content = ob_get_contents();
ob_end_clean();
return $content;
}
示例3: opendir
$field = $form->addTextField('hp_name', dyn::get('hp_name'));
$field->fieldName(lang::get('settings_name_of_site'));
$field = $form->addTextField('hp_url', dyn::get('hp_url'));
$field->fieldName(lang::get('settings_url_of_site'));
$field = $form->addSelectField('lang', dyn::get('lang'));
$field->fieldName(lang::get('settings_backend_lang'));
$handle = opendir(dir::backend('lib' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR));
while ($file = readdir($handle)) {
if (in_array($file, ['.', '..'])) {
continue;
}
$field->add($file, $file);
}
$field = $form->addSelectField('template', dyn::get('template'));
$field->fieldName(lang::get('template'));
$handle = opendir(dir::template());
while ($file = readdir($handle)) {
if (in_array($file, ['.', '..'])) {
continue;
}
$field->add($file, $file);
}
$field = $form->addLinkField('start_page', dyn::get('start_page'));
$field->fieldName(lang::get('start_page'));
$field = $form->addLinkField('error_page', dyn::get('error_page'));
$field->fieldName(lang::get('error_page'));
echo $form->show();
?>
</div>
</div>
</div>
示例4: __construct
public function __construct($template)
{
$this->name = $template;
$configfile = dir::template($template, 'config.json');
$this->config = json_decode(file_get_contents($configfile), true);
}