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


PHP f::resolve方法代碼示例

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


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

示例1: delete

 protected function delete($name, $output)
 {
     if ($file = f::resolve($this->root() . DS . $name, ['yaml', 'yml', 'php'])) {
         f::remove($file);
     }
     $output->writeln('<comment>The "' . $name . '" blueprint has been deleted!</comment>');
     $output->writeln('');
 }
開發者ID:getkirby,項目名稱:cli,代碼行數:8,代碼來源:Blueprint.php

示例2: _extend

 public function _extend($params)
 {
     $extends = $params['extends'];
     $snippet = f::resolve(kirby()->roots()->blueprints() . DS . 'fields' . DS . $extends, array('yml', 'php', 'yaml'));
     if (empty($snippet)) {
         throw new Exception(l('fields.error.extended'));
     }
     $yaml = data::read($snippet, 'yaml');
     $params = a::merge($yaml, $params);
     return $params;
 }
開發者ID:peterbinks,項目名稱:peterbinks.net,代碼行數:11,代碼來源:field.php

示例3: get

 /**
  * Retreives a registered blueprint file path 
  * 
  * @param string $name
  * @return string 
  */
 public function get($name = null)
 {
     if (is_null($name)) {
         return static::$blueprints;
     }
     $file = f::resolve($this->kirby->roots()->blueprints() . DS . str_replace('/', DS, $name), ['php', 'yml', 'yaml']);
     if (file_exists($file)) {
         return $file;
     } else {
         return a::get(static::$blueprints, $name);
     }
 }
開發者ID:kgchoy,項目名稱:main-portfolio-website,代碼行數:18,代碼來源:blueprint.php

示例4: load

 public function load()
 {
     // get the user role and load the
     // correspondant blueprint if available
     $this->name = basename(strtolower($this->user->role()));
     // try to find a user blueprint
     $file = f::resolve(static::$root . DS . $this->name, array('yml', 'php', 'yaml'));
     if ($file) {
         $this->file = $file;
         $this->yaml = data::read($this->file, 'yaml');
         // remove the broken first line
         unset($this->yaml[0]);
     }
 }
開發者ID:irenehilber,項目名稱:kirby-base,代碼行數:14,代碼來源:blueprint.php

示例5: __construct

 public function __construct(User $user)
 {
     // store the parent user object
     $this->user = $user;
     // this should rather be coming from the user object
     $this->kirby = kirby::instance();
     // try to find the avatar
     if ($file = f::resolve($this->kirby->roots()->avatars() . DS . $user->username(), ['jpg', 'jpeg', 'gif', 'png'])) {
         $filename = f::filename($file);
     } else {
         $filename = $user->username() . '.jpg';
         $file = $this->kirby->roots()->avatars() . DS . $filename;
     }
     parent::__construct($file, $this->kirby->urls()->avatars() . '/' . $filename);
 }
開發者ID:kgchoy,項目名稱:main-portfolio-website,代碼行數:15,代碼來源:avatar.php

示例6: exists

 public static function exists($name)
 {
     return f::resolve(static::$root . DS . $name, array('yml', 'php', 'yaml')) ? true : false;
 }
開發者ID:dmak78,項目名稱:panel,代碼行數:4,代碼來源:blueprint.php

示例7: exists

 protected function exists()
 {
     return f::resolve(dirname($this->file()) . '/' . f::name($this->file()), ['php', 'yml', 'yaml']);
 }
開發者ID:getkirby,項目名稱:cli,代碼行數:4,代碼來源:Blueprint.php


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