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

constructFile() private method

Create and return view of a given type
private constructFile ( string $type ) : Phrozn\Site\View
$type string File type to load
return Phrozn\Site\View
    private function constructFile($type)
    {
        // try to see if we have user defined plugin
        $class = 'PhroznPlugin\\Site\\View\\' . ucfirst($type);
        if (!class_exists($class)) {
            $class = 'Phrozn\\Site\\View\\' . ucfirst($type);
            if (!class_exists($class)) {
                //throw new \RuntimeException("View of type '{$type}' not found..");
                $class = 'Phrozn\\Site\\View\\Plain';
            }
        }
        $object = new $class();
        $object->setInputRootDir($this->getInputRootDir());
        $object->setInputFile($this->getInputFile());
        return $object;
    }