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
  • None
  • system
    • base
    • caching
    • console
    • db
      • ar
      • schema
    • validators
    • web
      • actions
      • auth
      • helpers
      • widgets
        • captcha
        • pagers
  • zii
    • widgets
      • grid

Classes

  • AdminController
  • Api2Controller
  • ApiController
  • BugReportsController
  • CommonSiteControllerBehavior
  • ProfileController
  • RelationshipsController
  • SearchController
  • SiteController
  • StudioController
  • TemplatesController
  • TopicsController
  • x2base
  • X2Controller
  • Overview
  • Package
  • Class
  • Tree

Class X2Controller

Base generic controller class

CComponent
Extended by CBaseController
Extended by CController
Extended by X2Controller

Direct known subclasses

AdminController, MobileController, x2base

Indirect known subclasses

AccountsController, ActionsController, OpportunitiesController, ProductsController, ProfileController, QuotesController, RelationshipsController, SearchController, ServicesController, SiteController, StudioController, TemplatesController, ApiController, TopicsController, UsersController, WorkflowController, X2LeadsController, BugReportsController, CalendarController, ContactsController, DocsController, GroupsController, MarketingController, MediaController
Abstract
Package: application\controllers
Located at x2engine/protected/controllers/X2Controller.php
Methods summary
public array
# actions( )

Returns a list of external action classes. Array keys are action IDs, and array values are the corresponding action class in dot syntax (e.g. 'edit'=>'application.controllers.article.EditArticle') or arrays representing the configuration of the actions, such as the following,

return array(
    'action1'=>'path.to.Action1Class',
    'action2'=>array(
        'class'=>'path.to.Action2Class',
        'property1'=>'value1',
        'property2'=>'value2',
    ),
);

Derived classes may override this method to declare external actions.

Returns a list of external action classes. Array keys are action IDs, and array values are the corresponding action class in dot syntax (e.g. 'edit'=>'application.controllers.article.EditArticle') or arrays representing the configuration of the actions, such as the following,

return array(
    'action1'=>'path.to.Action1Class',
    'action2'=>array(
        'class'=>'path.to.Action2Class',
        'property1'=>'value1',
        'property2'=>'value2',
    ),
);

Derived classes may override this method to declare external actions.

Note, in order to inherit actions defined in the parent class, a child class needs to merge the parent actions with child actions using functions like array_merge().

You may import actions from an action provider (such as a widget, see CWidget::actions), like the following:

return array(
    ...other actions...
    // import actions declared in ProviderClass::actions()
    // the action IDs will be prefixed with 'pro.'
    'pro.'=>'path.to.ProviderClass',
    // similar as above except that the imported actions are
    // configured with the specified initial property values
    'pro2.'=>array(
        'class'=>'path.to.ProviderClass',
        'action1'=>array(
            'property1'=>'value1',
        ),
        'action2'=>array(
            'property2'=>'value2',
        ),
    ),
)

In the above, we differentiate action providers from other action declarations by the array keys. For action providers, the array keys must contain a dot. As a result, an action ID 'pro2.action1' will be resolved as the 'action1' action declared in the 'ProviderClass'.

Returns

array
list of external action classes

See

CController::createAction()

Overrides

CController::actions()
public mixed
# resolveViewFile( string $viewName, string $viewPath, string $basePath, string $moduleViewPath = null )

Finds a view file based on its name. Overrides CBaseController::resolveViewFile to check if the requested view has a version in /custom, and uses that if it exists.

Finds a view file based on its name. Overrides CBaseController::resolveViewFile to check if the requested view has a version in /custom, and uses that if it exists.

Parameters

$viewName
string
$viewName the view name
$viewPath
string
$viewPath the directory that is used to search for a relative view name
$basePath
string
$basePath the directory that is used to search for an absolute view name under the application
$moduleViewPath
string
$moduleViewPath the directory that is used to search for an absolute view name under the current module. If this is not set, the application base view path will be used.

Returns

mixed
the view file path. False if the view file does not exist.

Overrides

CController::resolveViewFile()
public
# badRequest( mixed $message = null )
public
# redirectToLogin( )
public
# setFileFields( boolean $model, mixed $merge = false )

Set fields of model using uploaded files in super global

Set fields of model using uploaded files in super global

Parameters

$model
boolean
$merge if true, files will be merged with existing values
$merge
protected CHttpException
# badRequestException( mixed $message = null )

Returns

CHttpException
public
# isAjaxRequest( )

More reliable alternative to CHttpRequest::getIsAjaxRequest in cases where 'x2ajax' or 'ajax' parameters are being used. See http://www.yiiframework.com/forum/index.php?/topic/4945-yiiapp-request-isajaxrequest/

More reliable alternative to CHttpRequest::getIsAjaxRequest in cases where 'x2ajax' or 'ajax' parameters are being used. See http://www.yiiframework.com/forum/index.php?/topic/4945-yiiapp-request-isajaxrequest/

protected
# validateMobileRequest( mixed $action )

Rejects ajax requests to non-mobile actions from X2Touch.

Rejects ajax requests to non-mobile actions from X2Touch.

protected boolean
# beforeAction( CAction $action )

This method is invoked right before an action is to be executed (after all possible filters.) You may override this method to do last-minute preparation for the action.

This method is invoked right before an action is to be executed (after all possible filters.) You may override this method to do last-minute preparation for the action.

Parameters

$action
CAction
$action the action to be executed.

Returns

boolean
whether the action should be executed.

Overrides

CController::beforeAction()
protected
# runBehaviorBeforeActionHandlers( mixed $action )
protected
# getBehaviorActions( )
Methods inherited from CController
__construct(), accessRules(), afterAction(), afterRender(), beforeRender(), behaviors(), clearPageStates(), createAbsoluteUrl(), createAction(), createActionFromMap(), createUrl(), filterAccessControl(), filterAjaxOnly(), filterPostOnly(), filters(), forward(), getAction(), getActionParams(), getCachingStack(), getClips(), getId(), getLayoutFile(), getModule(), getPageState(), getPageTitle(), getRoute(), getUniqueId(), getViewFile(), getViewPath(), init(), invalidActionParams(), isCachingStackEmpty(), loadPageStates(), missingAction(), processDynamicOutput(), processOutput(), recordCachingAction(), redirect(), refresh(), render(), renderClip(), renderDynamic(), renderDynamicInternal(), renderPartial(), renderText(), replaceDynamicOutput(), run(), runAction(), runActionWithFilters(), savePageStates(), setAction(), setPageState(), setPageTitle()
Methods inherited from CBaseController
beginCache(), beginClip(), beginContent(), beginWidget(), createWidget(), endCache(), endClip(), endContent(), endWidget(), renderFile(), renderInternal(), widget()
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()
Constants inherited from CController
STATE_INPUT_NAME
Properties inherited from CController
$defaultAction, $layout
Magic properties inherited from CController
$action, $actionParams, $cachingStack, $clips, $id, $module, $pageTitle, $route, $uniqueId, $viewPath
X2CRM Documentation API documentation generated by ApiGen 2.8.0