Beispiel #1
0
 /**
  * sfPDFView::initialize()
  * This method is used instead of sfPHPView::initialze
  *
  * @param mixed $context
  * @param mixed $moduleName
  * @param mixed $actionName
  * @param mixed $viewName
  * @return
  **/
 public function initialize($context, $moduleName, $actionName, $viewName)
 {
     if (sfConfig::get('sf_logging_enabled')) {
         $context->getLogger()->info('{sfPDFView} is used for rendering');
     }
     parent::initialize($context, $moduleName, $actionName, $viewName);
 }
 public function initialize($context, $moduleName, $actionName, $viewName)
 {
     $this->nameSuffix = sfSmartphoneViewToolKit::getViewNameSuffixFromUA($this, $context, $moduleName, $actionName, $viewName, false);
     if ($this->nameSuffix) {
         $this->enableNameSuffix = sfSmartphoneViewToolKit::getViewNameSuffixFromUA($this, $context, $moduleName, $actionName, $viewName);
     }
     parent::initialize($context, $moduleName, $actionName, $viewName . sfInflector::camelize($this->enableNameSuffix));
 }
 /**
  * Constructor.
  * 
  * @see sfView
  */
 public function initialize($context, $moduleName, $actionName, $viewName)
 {
     $ret = parent::initialize($context, $moduleName, $actionName, $viewName);
     $this->viewCache = $this->context->getViewCacheManager();
     if (sfConfig::get('sf_cache')) {
         $this->checkCache = $this->viewCache->isActionCacheable($moduleName, $actionName);
     }
     return $ret;
 }
 /**
  * sfSmartyView::initialize()
  * This method is used instead of sfPHPView::initialze
  *
  * @param mixed $context
  * @param mixed $moduleName
  * @param mixed $actionName
  * @param mixed $viewName
  * @return
  **/
 public function initialize($context, $moduleName, $actionName, $viewName)
 {
     $this->setExtension(sfConfig::get('app_sfSmarty_template_extension', '.tpl'));
     parent::initialize($context, $moduleName, $actionName, $viewName);
     self::$smarty = sfSmarty::getInstance();
     if (sfConfig::get('sf_logging_enabled')) {
         $this->dispatcher->notify(new sfEvent($this, 'application.log', array('{sfSmartyView} is used for rendering')));
     }
     return true;
 }
 /**
  * Initializes this view.
  *
  * @param  sfContext $context     The current application context
  * @param  string    $moduleName  The module name for this view
  * @param  string    $actionName  The action name for this view
  * @param  string    $viewName    The view name
  * @return bool  true, if initialization completes successfully, otherwise false
  */
 public function initialize($context, $moduleName, $actionName, $viewName)
 {
     parent::initialize($context, $moduleName, $actionName, $viewName);
     $config = $context->getConfiguration();
     //sets up a Twig_Loader_Array with directories
     $this->twig_loaders['decorator'] = new Twig_Loader_FileSystem($config->getDecoratorDirs(), sfConfig::get('sf_template_cache_dir'));
     $this->twig_loaders['module'] = new Twig_Loader_FileSystem($config->getTemplateDirs($this->getModuleName()), sfConfig::get('sf_template_cache_dir'));
     //Setting the $loader to null lets us swap the loader out as we need it on the same instance.
     $this->twig = new Twig_Environment(null);
 }
Beispiel #6
0
 public function initialize($context, $moduleName, $actionName, $viewName)
 {
     parent::initialize($context, $moduleName, $actionName, $viewName);
     $format = $context->getRequest()->getRequestFormat();
     // make sure directory is set
     if (!$this->directory) {
         $this->setDirectory($this->context->getConfiguration()->getTemplateDir($this->moduleName, str_replace('.' . $format, '', $this->template)));
     }
     if ($format || $format != 'html') {
         $this->checkFallback($format);
     }
     return true;
 }
Beispiel #7
0
 public function initialize($context, $moduleName, $actionName, $viewName)
 {
     parent::initialize($context, $moduleName, $actionName, $viewName);
 }