dongpo3957 2014-02-05 00:24 采纳率: 0%
浏览 41

如何从s3加载Twig文件?

Trying to load twig template files from s3.

    $themePath = "https://path/to/s3/file";
    require_once APPLICATION_PATH.'/../library/Twig/Autoloader.php';
    Twig_Autoloader::register();



    $loader = new Twig_Loader_Filesystem($themePath);

    $this->appTwig = new Twig_Environment($loader, array(
     //   'cache' => APPLICATION_PATH.'/../cache',
    ));
    $this->view->appTwig = $this->appTwig;

      $this->template = $this->appTwig->loadTemplate($this->appView.'.yo');
      echo $this->template->render(array();

When I try to load a template file, I get an exception that says "directory does not exist".

Basically I want to store all the twig files on s3 so they are accessible from any of my servers. Have no clue how to make this work. It looks like Twig requires there to be a directory on a local machine as the file system. please help!!!

  • 写回答

0条回答 默认 最新

    报告相同问题?