Esempio n. 1
0
 /**
  * Load and render the view
  *
  * @param $view view file path (yii path alias)
  * @param null $data parameters to render in the view
  * @return string the rendered view
  * @throws CException if the view cannot be found
  */
 public function renderPartial($view, $data = null)
 {
     if (($viewFile = $this->getViewFile($view)) !== false) {
         $output = CConsoleCommand::renderFile($viewFile, $data, true);
         return $output;
     } else {
         throw new CException(Yii::t('yii', '{controller} cannot find the requested view "{view}".', array('{controller}' => get_class($this), '{view}' => $view)));
     }
 }