/**
  * Loads the Twig instance and registers the autoloader.
  */
 public function configure()
 {
     parent::configure();
     $this->configuration = $this->context->getConfiguration();
     // template name
     $template = sfConfig::get('sf_template');
     $templateDir = sfConfig::get('sf_template_dir') . '/' . $template;
     if (!file_exists($templateDir)) {
         throw new sfException(__METHOD__ . ": Couldn't find template " . $template);
     }
     // decorator template path
     $layoutTemplateDir = $templateDir . '/global';
     if (is_readable($layoutTemplateDir . '/' . $this->getDecoratorTemplate())) {
         $this->setDecoratorDirectory($layoutTemplateDir);
     }
     // module template path
     $moduleTemplateDir = $templateDir . '/modules/' . $this->moduleName;
     if (is_readable($moduleTemplateDir . '/' . $this->getTemplate())) {
         $this->setDirectory($moduleTemplateDir);
     }
     // init twig engine
     // empty array becuase it changes based on the rendering context
     $this->loader = new Twig_Loader_Filesystem(array());
     $this->twig = new sfTwigEnvironment($this->loader, array('cache' => sfConfig::get('sf_template_cache_dir') . '/' . $template, 'debug' => sfConfig::get('sf_debug', false), 'sf_context' => $this->context));
     if ($this->twig->isDebug()) {
         $this->twig->setAutoReload(true);
     }
     $this->loadExtensions();
 }
Beispiel #2
0
 public function configure()
 {
     if (sfConfig::get('sf_logging_enabled')) {
         $this->getContext()->getLogger()->info('{sfDomPDFView} is using' . $this->extension);
     }
     parent::configure();
 }
Beispiel #3
0
 /**
  * Configures template for this view.
  *
  * @throws <b>sfActionException</b> If the configure fails
  */
 public function configure()
 {
     // view.yml configure
     parent::configure();
     // require our configuration
     $moduleName = $this->moduleName;
     require sfConfigCache::getInstance()->checkConfig(sfConfig::get('sf_app_module_dir_name') . '/' . $this->moduleName . '/' . sfConfig::get('sf_app_module_config_dir_name') . '/mailer.yml');
 }
 /**
  * Configures template for this view.
  *
  * @throws <b>sfActionException</b> If the configure fails
  */
 public function configure()
 {
     // view.yml configure
     parent::configure();
     // require our configuration
     $moduleName = $this->moduleName;
     require $this->context->getConfigCache()->checkConfig('modules/' . $this->moduleName . '/config/mailer.yml');
 }
  public function configure()
  {
    parent::configure();
 
    // load some config values for this view
    //$moduleName = $this->moduleName;
    //require(sfConfigCache::getInstance()->checkConfig(sfConfig::get('sf_app_module_dir_name').'/'.$this->moduleName.'/'.sfConfig::get('sf_app_module_config_dir_name').'/tcpdf.yml'));
 
  }
Beispiel #6
0
 public function configure()
 {
     //$this->extension = '.tex';
     //partials: only .php
     if (sfConfig::get('sf_logging_enabled')) {
         $this->getContext()->getLogger()->info('{sfPDFView} is using' . $this->extension);
     }
     parent::configure();
 }
Beispiel #7
0
 /**
  * Loads the Twig instance and registers the autoloader.
  *
  * @return void
  */
 public function configure()
 {
     parent::configure();
     $this->configuration = $this->context->getConfiguration();
     //Empty array becuase it changes based on the rendering context
     $this->loader = new Twig_Loader_Filesystem(array());
     $this->twig = new Twig_Environment($this->loader, array('cache' => sfConfig::get('sf_template_cache_dir'), 'debug' => sfConfig::get('sf_debug', false)));
     if ($this->twig->isDebug()) {
         $this->twig->setCache(null);
         $this->twig->setAutoReload(true);
     }
     $this->loadExtensions();
 }
 /**
  * Loads the Twig instance and registers the autoloader.
  */
 public function configure()
 {
     parent::configure();
     $this->configuration = $this->context->getConfiguration();
     require_once sfConfig::get('sf_twig_lib_dir', dirname(__FILE__) . '/../lib/vendor/Twig/lib') . '/Twig/Autoloader.php';
     Twig_Autoloader::register();
     // empty array becuase it changes based on the rendering context
     $this->loader = new Twig_Loader_Filesystem(array());
     $this->twig = new sfTwigEnvironment($this->loader, array('cache' => sfConfig::get('sf_template_cache_dir'), 'debug' => sfConfig::get('sf_debug', false), 'sf_context' => $this->context));
     if ($this->twig->isDebug()) {
         $this->twig->enableAutoReload();
         $this->twig->setCache(null);
     }
     $this->loadExtensions();
 }
 public function configure()
 {
     parent::configure();
     if (!is_readable($this->getDirectory() . '/' . $this->getTemplate()) || !$this->directory) {
         $this->setDirectory($this->getTemplateDir($this->moduleName, $this->getTemplate()));
         // require our configuration
         $viewConfigFile = ncFlavorFlavors::getModulePath($this->moduleName) . '/config/view.yml';
         if (sfContext::getInstance()->getConfigCache()->checkConfig($viewConfigFile, true)) {
             require $config;
         }
     }
     if (!is_readable($this->getDecoratorDirectory() . '/' . $this->getDecoratorTemplate())) {
         $this->decoratorDirectory = $this->getGlobalTemplateDir($this->getDecoratorTemplate());
     }
 }
Beispiel #10
0
 public function configure()
 {
     parent::configure();
     // Grab the theme from the user (of from anywhere else)
     $theme = $this->getContext()->getUser()->getTheme();
     // If there is a theme and if the theme feature is enabled
     if ($theme && sfConfig::get('app_theme')) {
         // Look for templates in a $theme/ subdirectory of the usual template location
         if (is_readable($this->getDirectory() . '/' . $theme . '/' . $this->getTemplate())) {
             $this->setDirectory($this->getDirectory() . '/' . $theme);
         }
         // Look for a layout in a $theme/ subdirectory of the usual layout location
         if (is_readable($this->getDecoratorDirectory() . '/' . $theme . '/' . $this->getDecoratorTemplate())) {
             $this->setDecoratorDirectory($this->getDecoratorDirectory() . '/' . $theme);
         }
     }
 }
 public function configure()
 {
     $this->setExtension('.php');
     parent::configure();
 }
 public function configure()
 {
     $this->setExtension('.php');
     $this->setDecorator(false);
     parent::configure();
 }