本文整理汇总了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();
}
示例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);
}