Class NotificationsController
CController manages a set of actions which deal with the corresponding user requests.
Through the actions, CController coordinates the data flow between models and views.
When a user requests an action 'XYZ', CController will do one of the following:
- Method-based action: call method 'actionXYZ' if it exists;
- Class-based action: create an instance of class 'XYZ' if the class is found
in the action class map (specified via
CController::actions()
, and execute the action; - Call
CController::missingAction()
, which by default will raise a 404 HTTP exception.
If the user does not specify an action, CController will run the action
specified by CController::$defaultAction
, instead.
CController may be configured to execute filters before and after running actions. Filters preprocess/postprocess the user request/response and may quit executing actions if needed. They are executed in the order they are specified. If during the execution, any of the filters returns true, the rest filters and the action will no longer get executed.
Filters can be individual objects, or methods defined in the controller
class. They are specified by overriding CController::filters()
method. The following
is an example of the filter specification:
array( 'accessControl - login', 'ajaxOnly + search', array( 'COutputCache + list', 'duration'=>300, ), )
The above example declares three filters: accessControl, ajaxOnly, COutputCache. The first two are method-based filters (defined in CController), which refer to filtering methods in the controller class; while the last refers to an object-based filter whose class is 'system.web.widgets.COutputCache' and the 'duration' property is initialized as 300 (s).
For method-based filters, a method named 'filterXYZ($filterChain)' in the
controller class will be executed, where 'XYZ' stands for the filter name as
specified in CController::filters()
. Note, inside the filter method, you must call
<span class="php-var">$filterChain</span>->run()
if
the action should be executed. Otherwise, the filtering process would stop at
this filter.
Filters can be specified so that they are executed only when running certain actions. For method-based filters, this is done by using '+' and '-' operators in the filter specification. The '+' operator means the filter runs only when the specified actions are requested; while the '-' operator means the filter runs only when the requested action is not among those actions. For object-based filters, the '+' and '-' operators are following the class name.
- CComponent
- CBaseController
- CController
- NotificationsController
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/protected/controllers/NotificationsController.php
public
array
|
#
accessRules( )
Returns the access rules for this controller. Override this method if you use the filterAccessControl accessControl filter. |
public
|
|
public
|
#
getNotifications( mixed $lastId = 0, mixed $getNext = false )
Looks up notifications using the specified offset and limit |
public
|
|
public
|
#
actionDelete( type $id )
Delete an action by its ID. Encode and return the next notification if requested |
public
|
|
public static
string
|
#
convertLineBreaks( string $text, boolean $allowDouble = true, boolean $allowUnlimited = false )
Normalize linebreaks in output. |
__construct(),
actions(),
afterAction(),
afterRender(),
beforeAction(),
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(),
resolveViewFile(),
run(),
runAction(),
runActionWithFilters(),
savePageStates(),
setAction(),
setPageState(),
setPageTitle()
|
beginCache(),
beginClip(),
beginContent(),
beginWidget(),
createWidget(),
endCache(),
endClip(),
endContent(),
endWidget(),
renderFile(),
renderInternal(),
widget()
|
__call(),
__get(),
__isset(),
__set(),
__unset(),
asa(),
attachBehavior(),
attachBehaviors(),
attachEventHandler(),
canGetProperty(),
canSetProperty(),
detachBehavior(),
detachBehaviors(),
detachEventHandler(),
disableBehavior(),
disableBehaviors(),
enableBehavior(),
enableBehaviors(),
evaluateExpression(),
getEventHandlers(),
hasEvent(),
hasEventHandler(),
hasProperty(),
raiseEvent()
|
STATE_INPUT_NAME
|
$defaultAction,
$layout
|
$action,
$actionParams,
$cachingStack,
$clips,
$id,
$module,
$pageTitle,
$route,
$uniqueId,
$viewPath
|