yii\base\Controller::afterAction PHP Method

afterAction() public method

The method will trigger the [[EVENT_AFTER_ACTION]] event. The return value of the method will be used as the action return value. If you override this method, your code should look like the following: php public function afterAction($action, $result) { $result = parent::afterAction($action, $result); your custom code here return $result; }
public afterAction ( Action $action, mixed $result ) : mixed
$action Action the action just executed.
$result mixed the action return result.
return mixed the processed action result.
    public function afterAction($action, $result)
    {
        $event = new ActionEvent($action);
        $event->result = $result;
        $this->trigger(self::EVENT_AFTER_ACTION, $event);
        return $event->result;
    }