render() public method

The view to be rendered can be specified in one of the following formats: - path alias (e.g. "@app/views/site/index"); - absolute path within application (e.g. "//site/index"): the view name starts with double slashes. The actual view file will be looked for under the [[Application::viewPath|view path]] of the application. - absolute path within module (e.g. "/site/index"): the view name starts with a single slash. The actual view file will be looked for under the [[Module::viewPath|view path]] of the currently active module. - relative path (e.g. "index"): the actual view file will be looked for under [[viewPath]]. If the view name does not contain a file extension, it will use the default one .php.
public render ( string $view, array $params = [] ) : string
$view string the view name.
$params array the parameters (name-value pairs) that should be made available in the view.
return string the rendering result.
Beispiel #1
0
 public function render($view, $params = [])
 {
     if (is_null($view)) {
         $view = "{$this->classBaseNameID()}/run";
     }
     return parent::render($view, $params);
 }
Beispiel #2
0
 /**
  * @inheritdoc
  */
 public function render($view, $params = [])
 {
     return parent::render($this->getViewsPath() . '/' . $view, $params);
 }
 /**
  * Overridden to set view file path
  *
  * @param string $view
  * @param array $params
  * @return string
  */
 public function render($view, $params = [])
 {
     $renderParams = ArrayHelper::merge(['source' => $this->source, 'resultId' => $this->resultId], $params);
     return parent::render($view, $renderParams);
 }
Beispiel #4
0
 /**
  * @inheritdoc
  */
 public function render($view, $params = [])
 {
     $params['useFontAwesome'] = $this->useFontAwesome;
     $params['theme'] = $this->getThemeModule();
     $params['partRow'] = $this->partRow;
     $params['isInSidebar'] = $this->getIsInSidebar();
     $params['header'] = $this->header;
     $params['displayHeader'] = $this->displayHeader;
     return parent::render($view, $params);
 }