本文整理汇总了PHP中STemplate::process方法的典型用法代码示例。如果您正苦于以下问题:PHP STemplate::process方法的具体用法?PHP STemplate::process怎么用?PHP STemplate::process使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类STemplate
的用法示例。
在下文中一共展示了STemplate::process方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
public function render($tpl_name)
{
$tpl = new STemplate();
$tpl->vars =& $this->page->vars;
$tpl->controls =& $this->page->controls;
return $tpl->process($tpl_name);
}
示例2: render_layout
public static function render_layout($ctx, $content, $params)
{
$tpl = new STemplate();
$tpl->vars['__content__'] = $content;
if ($params === null) {
$params = array('path' => '');
}
if (array_key_exists('controller', $ctx->params)) {
$ctx->params['controller']->process($ctx, $params, $tpl->vars);
}
$path = BASE . 'layouts/' . $ctx->layout . '.php';
if (@file_exists($path)) {
require_once $path;
$class_name = self::capitalize_words($ctx->layout) . 'Layout';
$layout_inst = new $class_name();
$layout_inst->process($ctx, $params, $tpl->vars);
}
return $tpl->process(BASE . 'layouts/' . $ctx->layout . '.tpl');
}
示例3: error_handler
protected function error_handler()
{
$tpl = new STemplate();
$tpl->vars =& $this->vars;
$tpl->controls =& $this->controls;
$tpl->vars['__error__'] = $this->_error_message;
$res = $tpl->process($this->error_page_name);
$this->output_result($res);
}
示例4: render_template
protected function render_template()
{
if (!strlen($this->template_name)) {
throw new Exception('Please set $template_name variable');
}
$tpl = new STemplate();
$tpl->vars =& $this->vars;
$tpl->controls =& $this->page->controls;
return $tpl->process($this->template_name);
}
示例5: STemplate
<?php
require_once 's/s.php';
$tpl = new STemplate();
$tpl->vars['show_login_box'] = _SESSION('show_login_box', true);
$tpl->vars['login_error'] = '';
$tpl->vars['user_name'] = _SESSION('user_name');
if (inPOST('try_it')) {
if (_POST('login') != 'test' || _POST('password') != '12345') {
$tpl->vars['login_error'] = 'Invalid credentials. Try test/12345';
} else {
$_SESSION['user_name'] = 'Test test';
$_SESSION['show_login_box'] = false;
header('Location: ?' . (inGET('gimmedebug') ? 'gimmedebug=1' : ''));
return;
}
}
if (inPOST('try_again')) {
$_SESSION['show_login_box'] = true;
header('Location: ?' . (inGET('gimmedebug') ? 'gimmedebug=1' : ''));
return;
}
echo $tpl->process(BASE . 'index.tpl');
if (DEBUG) {
echo_debug();
}
示例6: render_form
public function render_form($data)
{
$tpl = new STemplate();
if (!array_key_exists('buttons', $data)) {
$data['buttons'] = array(array('id' => 'save', 'title' => Loc::get('cms/admin/save'), 'validate' => true));
}
if (!array_key_exists('fields_width', $data)) {
$data['fields_width'] = 480;
}
$tpl->vars['action_url'] = $this->get_action_url();
$tpl->vars['data'] = $data;
$tpl->vars['self'] = $this;
return $tpl->process(dirname(__FILE__) . '/base_admin_module.tpl');
}