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