當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。