Goetas\Twital\TwitalLoader::getSource PHP Method

getSource() public method

public getSource ( $name )
    public function getSource($name)
    {
        $source = $this->loader->getSource($name);
        if ($adapter = $this->getSourceAdapter($name)) {
            $source = $this->getTwital()->compile($adapter, $source);
        }
        return $source;
    }

Usage Example

Beispiel #1
0
 public function testNonTwitalFile()
 {
     $twital = $this->getMock('Goetas\\Twital\\Twital');
     $twitalLoader = new TwitalLoader(new StringLoader(), $twital, false);
     $twitalLoader->addSourceAdapter('/.*\\.xml$/', new XMLAdapter());
     $twital->expects($this->never())->method('compile');
     $twitalLoader->getSource('aaa.txt');
 }