Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • Net
  • None
  • PHP
  • system
    • base
    • caching
      • dependencies
    • collections
    • console
    • db
      • ar
      • schema
        • cubrid
        • mssql
        • mysql
        • oci
        • pgsql
        • sqlite
    • i18n
      • gettext
    • logging
    • test
    • utils
    • validators
    • web
      • actions
      • auth
      • filters
      • form
      • helpers
      • renderers
      • services
      • widgets
        • captcha
        • pagers
  • Text
    • Highlighter
  • zii
    • behaviors
    • widgets
      • grid
      • jui

Classes

  • CAction
  • CInlineAction
  • CreateWebFormAction
  • CViewAction
  • GetActionsBetweenAction
  • MobileAction
  • MobileActivityAction
  • MobileCreateAction
  • MobileDeleteAction
  • MobileIndexAction
  • MobileProfileViewAction
  • MobilePublisherAction
  • MobileResetPasswordAction
  • MobileTopicsCreateAction
  • MobileTopicsDeleteReplyAction
  • MobileTopicsIndexAction
  • MobileTopicsUpdateAction
  • MobileTopicsUpdateReplyAction
  • MobileTopicsViewAction
  • MobileUpdateAction
  • MobileViewAction
  • MobileViewEventAction
  • RecordAliasesCreateAction
  • RecordAliasesDeleteAction
  • WebFormAction
  • X2GridViewMassActionAction
  • X2ModelConversionAction
  • Overview
  • Package
  • Class
  • Tree

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
Extended by CAction implements IAction
Extended by CViewAction
Package: system\web\actions
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
Methods summary
public string
# getRequestedView( )

Returns the name of the view requested by the user. If the user doesn't specify any view, the CViewAction::$defaultView will be returned.

Returns the name of the view requested by the user. If the user doesn't specify any view, the CViewAction::$defaultView will be returned.

Returns

string
the name of the view requested by the user. This is in the format of 'path.to.view'.
protected string
# resolveView( string $viewPath )

Resolves the user-specified view into a valid view name.

Resolves the user-specified view into a valid view name.

Parameters

$viewPath
string
$viewPath user-specified view in the format of 'path.to.view'.

Returns

string
fully resolved view in the format of 'path/to/view'.

Throws

CHttpException
if the user-specified view is invalid
public
# run( )

Runs the action. This method displays the view requested by the user.

Runs the action. This method displays the view requested by the user.

Throws

CHttpException
if the view is invalid
public
# onBeforeRender( CEvent $event )

Raised right before the action invokes the render method. Event handlers can set the CEvent::$handled property to be true to stop further view rendering.

Raised right before the action invokes the render method. Event handlers can set the CEvent::$handled property to be true to stop further view rendering.

Parameters

$event
CEvent
$event event parameter
public
# onAfterRender( CEvent $event )

Raised right after the action invokes the render method.

Raised right after the action invokes the render method.

Parameters

$event
CEvent
$event event parameter
Methods inherited from CAction
__construct(), getController(), getId(), runWithParams(), runWithParamsInternal()
Methods inherited from CComponent
__call(), __get(), __isset(), __set(), __unset(), asa(), attachBehavior(), attachBehaviors(), attachEventHandler(), canGetProperty(), canSetProperty(), detachBehavior(), detachBehaviors(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), getEventHandlers(), hasEvent(), hasEventHandler(), hasProperty(), raiseEvent()
Magic methods inherited from CAction
run()
Properties summary
public string $viewParam 'view'
#

the name of the GET parameter that contains the requested view name. Defaults to '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 CViewAction::$viewParam GET parameter is not provided by user. Defaults to 'index'. This should be in the format of 'path.to.view', similar to that given in the GET parameter.

the name of the default view when CViewAction::$viewParam GET parameter is not provided by user. Defaults to 'index'. This should be in the format of 'path.to.view', similar to that given in the GET parameter.

See

CViewAction::$basePath
public string $view
#

the name of the view to be rendered. This property will be set once the user requested view is resolved.

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 tutorial.chap1, the corresponding view name will be pages/tutorial/chap1, assuming the base path is pages. The actual view file is determined by CController::getViewFile().

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 tutorial.chap1, the corresponding view name will be pages/tutorial/chap1, assuming the base path is pages. The actual view file is determined by CController::getViewFile().

See

CController::getViewFile()
public mixed $layout
#

the name of the layout to be applied to the views. This will be assigned to CController::$layout before the view is rendered. Defaults to null, meaning the controller's layout will be used. If false, no layout will be applied.

the name of the layout to be applied to the views. This will be assigned to CController::$layout before the view is rendered. Defaults to null, meaning the controller's layout will be used. If false, no layout will be applied.

public boolean $renderAsText false
#

whether the view should be rendered as PHP script or static text. Defaults to false.

whether the view should be rendered as PHP script or static text. Defaults to false.

Magic properties summary
public string $requestedView
#

The name of the view requested by the user. This is in the format of 'path.to.view'.

The name of the view requested by the user. This is in the format of 'path.to.view'.

Magic properties inherited from CAction
$controller, $id
API documentation generated by ApiGen 2.8.0