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

setInputFile() public method

Set input file path
public setInputFile ( string $path ) : Factory
$path string Path to file
return Factory
    public function setInputFile($path)
    {
        if (null !== $path) {
            if (!is_readable($path)) {
                throw new \RuntimeException("View source file cannot be read: {$path}");
            }
            $this->inputFile = $path;
        }
        return $this;
    }

Usage Example

Beispiel #1
0
 public function testNonExistantProcessor()
 {
     $path = dirname(__FILE__) . '/../project/.phrozn/entries/';
     $input = $path . '2011-02-24-wrong-file-type.wrong';
     $factory = new Factory();
     $view = $factory->setInputFile($input)->create();
     $this->assertInstanceOf('\\Phrozn\\Site\\View\\Plain', $view);
 }