当前位置: 首页>>代码示例>>PHP>>正文


PHP Director::BaseFolder方法代码示例

本文整理汇总了PHP中Director::BaseFolder方法的典型用法代码示例。如果您正苦于以下问题:PHP Director::BaseFolder方法的具体用法?PHP Director::BaseFolder怎么用?PHP Director::BaseFolder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Director的用法示例。


在下文中一共展示了Director::BaseFolder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 public function init()
 {
     parent::init();
     // set the paths as the document root
     $paths = array();
     if (is_array($this->config()->paths)) {
         foreach ($this->config()->paths as $path) {
             $paths[] = Director::BaseFolder() . "/" . $path;
         }
     } elseif (is_string($this->config()->paths)) {
         $paths[] = Director::BaseFolder() . "/" . $this->config()->paths;
     }
     // set the service
     $this->setService($this->config()->service, $paths);
     $this->setRequirements();
     // load the fixture file
     $this->loadFixture();
 }
开发者ID:helpfulrobot,项目名称:benmanu-silverstripe-styleguide,代码行数:18,代码来源:StyleGuideController.php

示例2: setService

 /**
  * Set the styleguide service on init.
  * @param String $name 		The name of the styleguide service.
  * @param String $paths  	Project base url.
  */
 public function setService($name, $paths = null)
 {
     if (!$paths) {
         // set the paths as the document root
         $paths = array();
         if (is_array($this->config()->paths)) {
             foreach ($this->config()->paths as $path) {
                 $paths[] = Director::BaseFolder() . "/" . $path;
             }
         } elseif (is_string($this->config()->paths)) {
             $paths[] = Director::BaseFolder() . "/" . $this->config()->paths;
         }
     }
     $this->styleguide_service = Injector::inst()->create($name);
     $this->styleguide_service->setURL($paths);
 }
开发者ID:benmanu,项目名称:silverstripe-styleguide,代码行数:21,代码来源:StyleGuideController.php


注:本文中的Director::BaseFolder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。