getRootPath() 공개 메소드

public getRootPath ( )
예제 #1
0
 /**
  * @dataProvider getGetRootPathTests
  */
 public function testGetRootPath($expected, $path)
 {
     $document = new Document();
     $document->setPath($path);
     $this->assertSame($expected, $document->getRootPath());
 }
예제 #2
0
파일: Twig.php 프로젝트: carew/carew
 private function setTwigGlobals(Document $document)
 {
     $twigGlobals = $this->twig->getGlobals();
     $globals = $twigGlobals['carew'];
     $globals->fromArray($document->getVars());
     $globals->relativeRoot = $document->getRootPath();
     $globals->currentPath = $document->getPath();
     $globals->document = $document;
     return $this;
 }