getSourceAdapter() public method

Decide if a template is twital-compilable or not.
public getSourceAdapter ( string $name ) : Goetas\Twital\SourceAdapter
$name string
return Goetas\Twital\SourceAdapter
示例#1
0
 function visitFile(\SplFileInfo $file, MessageCatalogue $catalogue)
 {
     if ($file->getExtension() == 'twital' && ($adapter = $this->twitalLoader->getSourceAdapter((string) $file))) {
         $source = $this->twitalLoader->getTwital()->compile($adapter, file_get_contents((string) $file));
         $ast = $this->twig->parse($this->twig->tokenize($source, (string) $file));
         $this->visitTwigFile($file, $catalogue, $ast);
     }
 }
示例#2
0
 /**
  *
  * @dataProvider getMatchedFilenames
  */
 public function testRegexAdapters($filename, $managed)
 {
     $twitalLoader = new TwitalLoader();
     $this->assertEquals($managed, !!$twitalLoader->getSourceAdapter($filename));
 }