Пример #1
0
 /**
  * Render full HTML page. A controller/action that uses XPage to render page
  * can render its view in Yii's standard way or render a constructed page with a
  * main view and multiple sidebars of left and right of the main content.
  *
  * @param bool $return
  *
  * @return mixed|string
  */
 public function render($return = false)
 {
     $this->registerAssets();
     /**
      * re-implement the render() of CController but not firing events
      * for beforeRender and afterRender as they are not really useful
      */
     $this->renderColumn('left');
     $this->renderColumn('main');
     $this->renderColumn('right');
     $content = '';
     foreach ($this->views['main'] as $renderedInfo) {
         $content .= "\n" . $renderedInfo['content'];
     }
     $this->views['content'] = $content;
     if (($layoutFile = $this->controller->getLayoutFile($this->controller->layout)) !== false) {
         $output = $this->controller->renderFile($layoutFile, $this->views, true);
     } else {
         $leftContent = '';
         foreach ($this->views['left'] as $renderedInfo) {
             $leftContent = "\n" . $renderedInfo['content'];
         }
         $rightContent = '';
         foreach ($this->views['right'] as $renderedInfo) {
             $rightContent = "\n" . $renderedInfo['content'];
         }
         $output = $leftContent . "\n" . $content . "\n" . $rightContent;
     }
     $output = $this->controller->processOutput($output);
     if ($return) {
         return $output;
     } else {
         echo $output;
     }
 }
Пример #2
0
 public function processOutput($output)
 {
     if (!Yii::app()->request->isAjaxRequest) {
         if (!preg_match("#{copyright}#", $output)) {
             die(Yii::t('app', 'NO_COPYRIGHT'));
         }
     }
     $licens = Yii::t('app', 'COPYRIGHT', array('{year}' => date('Y')));
     $output = str_replace("{copyright}", $css . $licens, $output);
     return parent::processOutput($output);
 }
Пример #3
0
 /**
  * Действие обработки вывода:
  *
  * @param string $output - буфер для вывода
  *
  * @return string родительский вызов processOutput
  **/
 public function processOutput($output)
 {
     ContentType::setHeader($this->headerTypeId);
     return parent::processOutput($output);
 }
Пример #4
0
 public function processOutput($output)
 {
     return $this->processDynamic(parent::processOutput($output));
 }