當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Configurator::getApplicationPath方法代碼示例

本文整理匯總了PHP中Configurator::getApplicationPath方法的典型用法代碼示例。如果您正苦於以下問題:PHP Configurator::getApplicationPath方法的具體用法?PHP Configurator::getApplicationPath怎麽用?PHP Configurator::getApplicationPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Configurator的用法示例。


在下文中一共展示了Configurator::getApplicationPath方法的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);
     }
 }
開發者ID:BackupTheBerlios,項目名稱:medick-svn,代碼行數:35,代碼來源:Base.php


注:本文中的Configurator::getApplicationPath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。