本文整理匯總了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);
}
}