当前位置: 首页>>代码示例>>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;未经允许,请勿转载。