本文整理汇总了PHP中CController::afterAction方法的典型用法代码示例。如果您正苦于以下问题:PHP CController::afterAction方法的具体用法?PHP CController::afterAction怎么用?PHP CController::afterAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CController
的用法示例。
在下文中一共展示了CController::afterAction方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: afterAction
protected function afterAction($action)
{
$time = sprintf('%0.5f', Yii::getLogger()->getExecutionTime());
$memory = round(memory_get_peak_usage() / (1024 * 1024), 2) . "MB";
echo '<!-- Time: ' . $time . 'ms, memory: ' . $memory . '-->';
parent::afterAction($action);
}
示例2: afterAction
protected function afterAction($action)
{
parent::afterAction($action);
if (!$this->readOnly) {
Yii::app()->unitOfWork->commit();
}
}
示例3: afterAction
public function afterAction($action)
{
## Make sure service daemon is started
if (!ServiceManager::checkDaemon()) {
ServiceManager::startDaemon();
}
parent::afterAction($action);
return true;
}
示例4: afterAction
/**
* @name afterAction
* @var $action
*
*/
public function afterAction($action)
{
parent::afterAction($action);
if (Yii::app()->params['statistik']) {
if ('site.updatemsg' != $this->getId() . '.' . $action->id) {
Yii::log($this->getTimeStamp() . '.' . $this->getId() . '.' . $action->id . ',' . Yii::app()->user->name . ',' . $_SERVER['REMOTE_ADDR'], 'info', 'statistik');
}
}
}
示例5: afterAction
public function afterAction($action)
{
parent::afterAction($action);
}
示例6: afterAction
public function afterAction($action)
{
if ($this->isActionAttachedByActionsMethod($action)) {
return parent::afterAction($action);
}
$this->renderAndLogResponse();
return parent::afterAction($action);
}
示例7: afterAction
protected function afterAction($action)
{
$this->viewStatistic->run();
parent::afterAction($action);
// TODO: Change the autogenerated stub
}
示例8: afterAction
/**
* Checks request type and call response.
*
* @param $action
*/
protected function afterAction($action)
{
if ($this->error == null && !$this->isFromCache) {
if ($this->beforeToArray && is_callable($this->beforeToArray)) {
call_user_func($this->beforeToArray, $this->data);
}
$this->toArray();
if ($this->action instanceof IPostProcessable) {
$this->action->postProcessing($this->data);
if (is_array($this->data) && count($this->data) == 0) {
throw new NotFoundApiException();
}
}
if ($this->requestType == 'Param') {
\Yii::app()->apiCache->set($this->key, $this->data, self::CACHE_EXPIRE);
$this->setModelCollectionCache();
$this->setHeadersCache();
}
}
if ($this->checkRequestType('GET') && $this->action instanceof IViewIncrementable) {
if ($this->action->viewsIncrement() && $this->isFromCache) {
\Yii::app()->apiCache->delete($this->key);
}
}
//if data contains 1 element - returns object, not array. except get pagination request.
/**@todo: bad idea, need refactor*/
if (!$this->checkRequestType('GET') || \Yii::app()->request->getParam('id', null) || \Yii::app()->request->getParam('url', null)) {
if ($this->error == null && $this->data != null && is_array($this->data) && count($this->data) == 1) {
$this->data = $this->data[0];
}
}
$this->complete();
parent::afterAction($action);
}
示例9: afterAction
/**
* This method is invoked right after an action is executed.
* You may override this method to do some postprocessing for the action.
* @param CAction $action the action just executed.
*/
protected function afterAction($action)
{
SourceBans::app()->trigger('app.afterAction', new CEvent($this, array('action' => $action)));
parent::afterAction($action);
}