public function setTemplatePath($path, \Twig_Environment $twig = null, $extensions = [])
    {
        $this->paths['templates'] = $path;

        if (is_null($twig) === true) {
            $loader = new \Twig_Loader_Filesystem($path);

            $twig = new \Twig_Environment($loader);
        }

        $twig->setExtensions($extensions);

        $this->injector->share($twig);

        return $this;
    }
public function setTemplatePath($path, \Twig_Environment $twig = null, $extensions = [])
    {
        $this->paths['templates'] = $path;

        if (is_null($twig) === true) {
            $loader = new \Twig_Loader_Filesystem($path);

            $twig = new \Twig_Environment($loader);
        }

        $twig->setExtensions($extensions);

        $this->injector->share($twig);

        return $this;
    }
public function setTemplatePath ( $ path , \ Twig_Environment $ twig = null , $ extensions = [ ] ) { $ this -> paths [ 'templates' ] = $ path ; if ( is_null ( $ twig ) === true ) { $ loader = new \ Twig_Loader_Filesystem ( $ path ) ; $ twig = new \ Twig_Environment ( $ loader ) ; } $ twig -> setExtensions ( $ extensions ) ; $ this -> injector -> share ( $ twig ) ; return $ this ; }
Sets the templates path.

@param  string                 $path
@param  \Twig_Environment|null $twig
@param  array                  $extensions
@return self
Sets the templates path .