Example #1
0
 public function getView($name = '', $type = '', $prefix = '', $config = array())
 {
     $view = parent::getView($name, $type, $prefix, $config);
     $view_name = $view->getName() ? $view->getName() : $this->default_view;
     // Default templates and partials paths
     $view->addTemplatePath($this->app->path->path('zoocart:views/' . $this->_scope . '/partials'));
     if ($path = $this->app->path->path('zoocart:views/' . $this->_scope . '/' . $view_name . '/tmpl')) {
         $view->addTemplatePath($path);
     }
     // Look for templates and partials overrides
     $cur_template = JFactory::getApplication()->getTemplate();
     $subfolder = $this->_scope == 'admin' ? 'administrator/' : '';
     if ($path = $this->app->path->path('root:' . $subfolder . 'templates/' . $cur_template . '/html/plg_system_zoocart/' . $view_name)) {
         $view->addTemplatePath($path);
     }
     if ($path = $this->app->path->path('root:' . $subfolder . 'templates/' . $cur_template . '/html/plg_system_zoocart/partials')) {
         $view->addTemplatePath($path);
     }
     return $view;
 }
Example #2
0
 /**
  * Get view for controller && task
  * @param string $name
  * @param string $type
  * @param string $prefix
  * @param array $config
  * @return AppView
  */
 public function getView($name = '', $type = '', $prefix = '', $config = array())
 {
     $config['template_path'] = $this->app->path->path('jbviews:');
     return parent::getView($name, $type, $prefix, $config);
 }