コード例 #1
0
 public function render($view, $vars = array())
 {
     $views_path = PLUGINS_ROOT . DS . 'ckeditor' . DS . 'views' . DS . 'filter';
     if (defined('CMS_BACKEND')) {
         $views_path .= DS . 'admin';
         if (!empty($this->layout)) {
             // We assign our Views as content already rendered
             $this->assignToLayout('content_for_layout', new View($views_path . DS . $view, $vars));
             // and render the backend layout as usual
             return new View('../layouts/' . $this->layout, $this->layout_vars);
         } else {
             return new View($views_path . DS . $view, $vars);
         }
     } else {
         $views_path .= DS . 'public';
         return parent::render($views_path . DS . $view, $vars);
     }
 }
コード例 #2
0
 public function render($view, $vars = array())
 {
     $vars = array_merge($this->get_default_view_vars(), $vars);
     /* We only render views for this plugin. So add the prefix of the view folder to every view file. */
     return parent::render(self::VIEW_FOLDER . $view, $vars);
 }