Phrozn\Site\View\Factory::create PHP Method

create() public method

return \Phrozn\Site\View\Factory
public create ( )
    public function create()
    {
        $ext = pathinfo($this->getInputFile(), PATHINFO_EXTENSION);
        $type = $ext ?: self::DEFAULT_VIEW_TYPE;
        return $this->constructFile($type);
    }

Usage Example

Beispiel #1
0
 protected function buildQueue()
 {
     $projectDir = $this->getProjectDir();
     $outputDir = $this->getOutputDir();
     $item = new \SplFileObject($this->getSingleFile());
     if ($item->isFile()) {
         try {
             $factory = new View\Factory($item->getRealPath());
             $view = $factory->create();
             $view->setSiteConfig($this->getSiteConfig())->setOutputDir($outputDir);
             $this->addView($view);
         } catch (\Exception $e) {
             $this->getOutputter()->stderr(str_replace($projectDir, '', $item->getRealPath()) . ': ' . $e->getMessage());
         }
     }
     return $this;
 }
All Usage Examples Of Phrozn\Site\View\Factory::create