Example #1
0
 protected function getDiff(Project $project)
 {
     return new Diff($project, $project->getBuildDir() . '/renderer.index');
 }
 protected function save(Project $project, $uri, $template, $variables)
 {
     $this->twig->getExtension('sami')->setCurrentDepth(substr_count($uri, '/'));
     $file = $project->getBuildDir() . '/' . $uri;
     if (!is_dir($dir = dirname($file))) {
         $this->filesystem->mkdir($dir);
     }
     file_put_contents($file, $this->twig->render($template, $variables));
 }