本文整理汇总了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('');
}
示例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;
}
示例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);
}
}
示例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]);
}
}
示例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);
}
示例6: exists
public static function exists($name)
{
return f::resolve(static::$root . DS . $name, array('yml', 'php', 'yaml')) ? true : false;
}
示例7: exists
protected function exists()
{
return f::resolve(dirname($this->file()) . '/' . f::name($this->file()), ['php', 'yml', 'yaml']);
}