fromPath() public static method

Create new File instance from path
public static fromPath ( string $path, array $meta = [] ) : static
$path string
$meta array
return static
コード例 #1
0
ファイル: cms.php プロジェクト: sphido/cms
 function __invoke($method, $path, $cms)
 {
     $this->cms = $cms = $this;
     // include prepend PHP file first
     is_file($php = \dir\content($path . '/index.php')) ? include_once $php : null || is_file($php = \dir\content($path . '.php')) ? include_once $php : null;
     // search page (html, md, latte, phtml)
     $this->page = Page::fromPath(\dir\content() . '/' . $path, (array) config()->meta);
     // include functions.php from $path and working directory
     is_file($php = \dir\content($path . '/functions.php')) ? include_once $php : null;
     is_file(getcwd() . '/functions.php') ? include_once getcwd() . '/functions.php' : null;
     print $this->page ? $this->render() : \route\error(404, $method, $path, $this);
 }