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


PHP Engine::make方法代碼示例

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


在下文中一共展示了Engine::make方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: render

 /**
  * Render the template and layout.
  * @param  array  $data
  * @return string
  */
 public function render(array $data = array())
 {
     try {
         $this->data($data);
         unset($data);
         extract($this->data);
         ob_start();
         if ($this->exists()) {
             include $this->path();
         } else {
             throw new LogicException('The template "' . $this->name->getName() . '" could not be found at "' . $this->path() . '".');
         }
         $content = ob_get_clean();
         if (isset($this->layoutName)) {
             $layout = $this->engine->make($this->layoutName);
             $layout->sections = array_merge($this->sections, array('content' => $content));
             $content = $layout->render($this->layoutData);
         }
         return $content;
     } catch (LogicException $e) {
         if (ob_get_length() > 0) {
             ob_end_clean();
         }
         throw $e;
     }
 }
開發者ID:jothamhernandez,項目名稱:PT_HIFI,代碼行數:31,代碼來源:Template.php

示例2: fetch

 /**
  * Fetch a rendered template.
  * @param  string $name
  * @param  array  $data
  * @return string
  */
 protected function fetch($name, array $data = array())
 {
     //return $this->engine->render($name, $data);
     $template = $this->engine->make($name);
     $template->sections = $this->sections;
     return $template->render($data);
 }
開發者ID:jezqhiel,項目名稱:cms-packages,代碼行數:13,代碼來源:Template.php

示例3: compileFile

 /**
  * Parse php files
  *
  * @param string $filename
  * @return string parsed content
  */
 protected function compileFile($filename)
 {
     $template = $this->engine->make($filename);
     $content = $template->render();
     return $content;
 }
開發者ID:odan,項目名稱:plates-asset-cache,代碼行數:12,代碼來源:AssetCache.php

示例4: makeTemplate

 protected function makeTemplate($name)
 {
     return $this->templater->make($name);
 }
開發者ID:JordanRL,項目名稱:eden,代碼行數:4,代碼來源:AbstractController.php

示例5: body

 /**
  * @inheritDoc
  */
 public function body(PayloadInterface $payload)
 {
     $template = $this->template($payload);
     $template = $this->engine->make($template);
     return $this->render($template, $payload);
 }
開發者ID:jbmadking,項目名稱:scheduler-test,代碼行數:9,代碼來源:PlatesFormatter.php


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