本文整理汇总了PHP中Templates::HTML方法的典型用法代码示例。如果您正苦于以下问题:PHP Templates::HTML方法的具体用法?PHP Templates::HTML怎么用?PHP Templates::HTML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Templates
的用法示例。
在下文中一共展示了Templates::HTML方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fallback
protected function fallback($name, $parms, $args)
{
$name = trim($name, '/');
$this->views_paths[] = '';
$template = $this->search_fallback_template($name);
if ($template) {
$args = array('env' => WS::env(), 'request' => WS::env()->request, 'args' => $parms, 'args_array' => $args, 'insertion_name' => $name);
Events::call("cms.insertions.template.{$name}", $template, $args);
if (isset($this->args['layout'])) {
return $this->args['layout']->root->partial($template, $args);
}
return Templates::HTML($template)->with($args)->render();
}
return null;
}
示例2: run
/**
* @param WS_Environment $env
*
* @return Net_HTTP_Response
*/
public function run(WS_Environment $env)
{
//if ($this->disabled) return $this->application->run($env);
$error = null;
try {
$body = $this->application->run($env);
$response = Net_HTTP::merge_response($body, $env->response);
} catch (Exception $e) {
$error = $e;
if ($this->disabled) {
throw $e;
}
$response = Net_HTTP::Response(Net_HTTP::INTERNAL_SERVER_ERROR);
}
if (!$response->body && ($template = $this->find_template_name_for($response->status))) {
if (isset($env->not_found->static_file)) {
$response->body(IO_FS::File($env->not_found->static_file));
} else {
$layout = isset($env->not_found->layout) ? $env->not_found->layout : 'work';
$view = Templates::HTML($template);
if ($layout) {
$view->within_layout($layout);
}
$view->root->with(array('env' => $env, 'response' => $response, 'error' => $error));
if ($view->exists()) {
$response->body($view);
} else {
if (IO_FS::exists($static_name = $template . '.html')) {
$response->body(IO_FS::File($static_name));
}
}
}
}
Events::call('ws.status', $response);
return $response;
}