Phrozn/Site/View/Factory.php
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;
    }
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;
    }
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 ; }
Create and return view of a given type

@param string $type File type to load

@return \Phrozn\Site\View
Create and return view of a given type