Class CViewAction
CViewAction represents an action that displays a view according to a user-specified parameter.
By default, the view being displayed is specified via the view
GET parameter. The name of the GET parameter can be customized via CViewAction::$viewParam
. If the user doesn't provide the GET parameter, the default view
specified by CViewAction::$defaultView
will be displayed.
Users specify a view in the format of path.to.view
, which
translates to the view name BasePath/path/to/view
where
BasePath
is given by CViewAction::$basePath
.
Note, the user specified view can only contain word characters, dots and dashes and the first letter must be a word letter.
- CComponent
- CAction implements IAction
- CViewAction
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/framework/web/actions/CViewAction.php
public
string
|
#
getRequestedView( )
Returns the name of the view requested by the user. If the user doesn't
specify any view, the |
protected
string
|
|
public
|
|
public
|
#
onBeforeRender(
Raised right before the action invokes the render method. Event handlers can
set the |
public
|
__construct(),
getController(),
getId(),
runWithParams(),
runWithParamsInternal()
|
run()
|
public
string
|
$viewParam | 'view' |
#
the name of the GET parameter that contains the requested view name. Defaults to 'view'. |
public
string
|
$defaultView | 'index' |
#
the name of the default view when |
public
string
|
$view |
|
#
the name of the view to be rendered. This property will be set once the user requested view is resolved. |
public
string
|
$basePath | 'pages' |
#
the base path for the views. Defaults to 'pages'. The base path will be
prefixed to any user-specified page view. For example, if a user requests for
|
public
mixed
|
$layout |
|
#
the name of the layout to be applied to the views. This will be assigned to
|
public
boolean
|
$renderAsText | false |
#
whether the view should be rendered as PHP script or static text. Defaults to false. |
public
string
|
$requestedView |
#
The name of the view requested by the user. This is in the format of 'path.to.view'. |
$controller,
$id
|