base\Controller setViewPath()

setViewPath() public method (available since version 2.0.7) Sets the directory that contains the view files. public void setViewPath ( $path )$path string The root directory of view files. throws yii\base\InvalidParamException if the directory is invalid

base\Controller setView()

setView() public method Sets the view object to be used by this controller. public void setView ( $view )$view yii\base\View|yii\web\View The view object that can be used to render views or view files.

base\Controller __construct()

__construct() public method public void __construct ( $id, $module, $config = [] )$id string The ID of this controller. $module yii\base\Module The module that this controller belongs to. $config array Name-value pairs that will be used to initialize the object properties.

base\Controller runAction()

runAction() public method Runs an action within this controller with the specified action ID and parameters. If the action ID is empty, the method will use $defaultAction. See also createAction(). public mixed runAction ( $id, $params = [] )$id string The ID of the action to be executed. $params array The parameters (name-value pairs) to be passed to the action. return mixed The result of the action. throws yii\base\InvalidRouteException if the requested action ID cannot be resolve

base\Controller renderContent()

renderContent() public method (available since version 2.0.1) Renders a static string by applying a layout. public string renderContent ( $content )$content string The static string being rendered return string The rendering result of the layout with the given static string as the $content variable. If the layout is disabled, the string will be returned back.

base\Controller renderFile()

renderFile() public method Renders a view file. public string renderFile ( $file, $params = [] )$file string The view file to be rendered. This can be either a file path or a path alias. $params array The parameters (name-value pairs) that should be made available in the view. return string The rendering result. throws yii\base\InvalidParamException if the view file does not exist.

base\Controller renderPartial()

renderPartial() public method Renders a view without applying layout. This method differs from render() in that it does not apply any layout. public string renderPartial ( $view, $params = [] )$view string The view name. Please refer to render() on how to specify a view name. $params array The parameters (name-value pairs) that should be made available in the view. return string The rendering result. throws yii\base\InvalidParamException if the view file does not exist.

base\Controller run()

run() public method Runs a request specified in terms of a route. The route can be either an ID of an action within this controller or a complete route consisting of module IDs, controller ID and action ID. If the route starts with a slash '/', the parsing of the route will start from the application; otherwise, it will start from the parent module of this controller. See also runAction(). public mixed run ( $route, $params = [] )$route string The route to be handled, e.g., 'view', 'comm

base\Controller getView()

getView() public method Returns the view object that can be used to render views or view files. The render(), renderPartial() and renderFile() methods will use this view object to implement the actual view rendering. If not set, it will default to the "view" application component. public yii\base\View|yii\web\View getView ( )return yii\base\View|yii\web\View The view object that can be used to render views or view files.

base\Controller getViewPath()

getViewPath() public method Returns the directory containing view files for this controller. The default implementation returns the directory named as controller $id under the $module's $viewPath directory. public string getViewPath ( )return string The directory containing the view files for this controller.