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


PHP Engine::setDirectory方法代碼示例

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


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

示例1: addPath

 /**
  * Add a path for template
  *
  * Multiple calls to this method without a namespace will trigger an
  * E_USER_WARNING and act as a no-op. Plates does not handle non-namespaced
  * folders, only the default directory; overwriting the default directory
  * is likely unintended.
  *
  * @param string $path
  * @param string $namespace
  */
 public function addPath($path, $namespace = null)
 {
     if (!$namespace && !$this->template->getDirectory()) {
         $this->template->setDirectory($path);
         return;
     }
     if (!$namespace) {
         trigger_error('Cannot add duplicate un-namespaced path in Plates template adapter', E_USER_WARNING);
         return;
     }
     $this->template->addFolder($namespace, $path, true);
 }
開發者ID:weierophinney,項目名稱:zend-expressive-platesrenderer,代碼行數:23,代碼來源:PlatesRenderer.php

示例2: __construct

 public function __construct(Module $module, array $data = [])
 {
     $this->engine = new Engine(VIEWPATH, 'php');
     foreach ($module->getList('module') as $mod) {
         if (is_dir($mod_view = $mod->path . 'mod/views/')) {
             $this->paths[$mod->name] = $mod_view;
             $this->engine->addFolder($mod->name, $mod_view);
         }
     }
     if ($currentModule = $module->getCurrent()) {
         $this->engine->setDirectory($this->paths[$currentModule]);
     }
 }
開發者ID:projek-xyz,項目名稱:ci-common,代碼行數:13,代碼來源:Views.php

示例3: __construct

 /**
  * The transformer constructor.
  *
  * Options are:
  *   - "plates" a \League\Plates\Engine instance
  *   - "directory" the directory where Plates will search templates
  *   - "extension" the extension of template files
  * if the option "plates" is provided, options "default" and "extension" are ignored.
  *
  * @param array $options The PlatesTransformer options
  */
 public function __construct(array $options = array())
 {
     if (array_key_exists('plates', $options)) {
         $this->plates = $options['plates'];
         return;
     }
     $this->plates = new Engine(getcwd(), null);
     if (array_key_exists('directory', $options)) {
         $this->plates->setDirectory($options['directory']);
     }
     if (array_key_exists('extension', $options)) {
         $this->plates->setFileExtension($options['extension']);
     }
 }
開發者ID:phptransformers,項目名稱:plates,代碼行數:25,代碼來源:PlatesTransformer.php

示例4: __construct

 /**
  * Create new Views Instance
  *
  * @param array|Module $module
  */
 public function __construct($module)
 {
     if (is_array($module)) {
         $module = array_shift($module);
     }
     $this->engine = new Engine(VIEWPATH, 'tpl');
     foreach ($module->getList('module') as $mod) {
         if (is_dir($mod_view = $module->getPath($mod->name) . 'views/')) {
             $this->add_folder($mod->name, $mod_view);
         }
     }
     if ($current_module = $module->getCurrent()) {
         $this->engine->setDirectory($this->paths[$current_module]);
     }
 }
開發者ID:bootigniter,項目名稱:project,代碼行數:20,代碼來源:Views.php

示例5: setViewDirectory

 public function setViewDirectory($viewDir)
 {
     $this->template->setDirectory($viewDir);
 }
開發者ID:louislam,項目名稱:louislam-crud,代碼行數:4,代碼來源:LouisCRUD.php


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