本文整理汇总了PHP中Configurator::getApplicationName方法的典型用法代码示例。如果您正苦于以下问题:PHP Configurator::getApplicationName方法的具体用法?PHP Configurator::getApplicationName怎么用?PHP Configurator::getApplicationName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configurator
的用法示例。
在下文中一共展示了Configurator::getApplicationName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render_file
/**
* It renders the template file.
*
* This method is usefull when you don`t want to use the default template_root
* Special helper file is included.
* Magic __layout.phtml is loaded if exists.
*
* @param string, template_file location of the template file, default NULL
* @param Response::SC_*, status, [optional] status code, default is 200 OK
* @throws FileNotFoundException if the template file don`t exist on the specified location.
* @return void
*/
protected function render_file($template_file, $status = NULL)
{
if (!is_file($template_file)) {
throw new FileNotFoundException('Cannot render unexistent template file:' . $template_file);
}
// load helper
$this->injector->inject('helper', $this->params['controller']);
// register flash
$this->register_flash();
if ($this->use_layout) {
$layout = $this->use_layout === TRUE ? $this->params['controller'] : $this->use_layout;
$layout_file = $this->injector->getPath('layouts') . $layout . '.phtml';
$this->logger->debug('[Medick] >> Using layout: ' . str_replace($this->config->getApplicationPath(), '${' . $this->config->getApplicationName() . '}', $layout_file));
if (!is_file($layout_file)) {
return $this->render_without_layout($template_file, $status);
} else {
$this->template->content_for_layout = $this->template->render_file($template_file);
return $this->render_text($this->template->render_file($layout_file), $status);
}
} else {
return $this->render_without_layout($template_file, $status);
}
}