本文整理汇总了PHP中content::end方法的典型用法代码示例。如果您正苦于以下问题:PHP content::end方法的具体用法?PHP content::end怎么用?PHP content::end使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类content
的用法示例。
在下文中一共展示了content::end方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadFile
static function loadFile($file, $vars = array(), $return = false)
{
if (!file_exists($file)) {
return false;
}
@extract(self::$vars);
@extract($vars);
content::start();
require $file;
return content::end($return);
}
示例2: load
function load($template = 'default', $vars = array(), $return = false)
{
$file = c::get('tpl.root') . '/' . $template . '.php';
if (!file_exists($file)) {
return false;
}
@extract(self::$vars);
@extract($vars);
content::start();
require $file;
return content::end($return);
}
示例3: field
function field($field)
{
global $panel;
extract($field);
// define a size selector
$default = isset($default) ? $default : false;
$size = isset($size) ? ' ' . $size : '';
$value = get($name, a::get($this->data, $name, $default));
$output = array();
$output[] = '<div class="field ' . $type . $size . '">';
$output[] = self::label($label);
// load the field template
content::start();
require $file;
$output[] = content::end(true);
// add the help text if available
if (!empty($help)) {
$output[] = self::help($help);
}
$output[] = '</div>';
return implode("\n", $output);
}
示例4: load
function load()
{
// initiate the site and make pages and page
// globally available
$site = $this;
$panel = $this;
$pages = $this->pages;
$page = $this->pages->active();
if ($page->isErrorPage() && $this->uri()->path() != c::get('404')) {
go(url(c::get('404')));
}
g::set('site', $this);
g::set('panel', $this);
g::set('pages', $pages);
g::set('page', $page);
// set the global template vars
tpl::set('site', $this);
tpl::set('panel', $this);
tpl::set('pages', $pages);
tpl::set('page', $page);
// initiate the user settings
$settings = new settings();
g::set('settings', $settings);
tpl::set('settings', $settings);
// add a user
$panel->user = new user();
// load the language
paneload::language();
// check for a valid array of user accounts and other correct setups
if (!check::installed() || !check::hasAccounts() || check::stillHasDefaultAccount() || check::wrongKirbyVersion()) {
require c::get('root.panel') . '/modals/installation.php';
return;
}
// add all panel info
$panel->isHome = !$panel->uri->path(1) ? true : false;
$panel->show = $panel->uri->param('show');
$panel->action = $panel->uri->param('do');
$panel->nocontent = (string) $page->contents() == '' ? true : false;
if ($panel->isHome && $panel->show != 'info' && $panel->show != 'logout') {
$panel->show = 'home';
}
switch ($panel->action) {
case 'edit-pages':
$panel->sortable = true;
break;
}
if ($panel->isHome) {
$settings->pages = true;
$settings->flip = false;
}
switch ($panel->show) {
case 'logout':
$panel->user->logout();
exit;
break;
case 'files':
$thumbDir = c::get('root') . '/thumbs';
$panel->fancybox = true;
$panel->thumbs = is_dir($thumbDir) && is_writable($thumbDir) ? true : false;
break;
// more available views
// more available views
case 'info':
case 'home':
case 'pages':
case 'options':
if (($panel->show == 'home' || $panel->show == 'info') && !$panel->isHome) {
go(url() . '/show:' . $panel->show);
}
break;
default:
$valid = array('options', 'content');
if (!in_array($panel->show, $valid)) {
$panel->show = 'content';
}
break;
}
// init the form
if ($panel->show == 'info' || $panel->show == 'content') {
$panel->form = new form($settings);
}
// set the template file;
$panel->templateFile = $panel->show . '.php';
$panel->templateRoot = c::get('root.panel') . '/templates';
content::start();
if ($panel->user->isLoggedIn()) {
require $panel->templateRoot . '/' . $panel->templateFile;
} else {
require $panel->templateRoot . '/login.php';
}
content::end();
}
示例5: load
static function load($username)
{
// check for an existing user account file
$file = c::get('root.site') . '/' . c::get('panel.folder') . '/accounts/' . $username . '.php';
if (!file_exists($file)) {
return false;
}
// load the account credentials
content::start();
require $file;
$account = content::end(true);
$account = spyc_load($account);
if (!is_array($account)) {
return false;
}
// check for required fields
$missing = a::missing($account, array('username', 'password'));
if (!empty($missing)) {
return false;
}
return $account;
}
示例6: fieldtemplate
function fieldtemplate($params)
{
content::start();
extract($params);
require $file;
return content::end(true);
}