controller_after.*

Triggered after the execution of a specified PHP controller.

Teamwork

Input (passed by reference)

$params['controller'] object Controller class instance.
$params['params'] array The parameters used for the controller execution.
$params['result'] mixed The result returned by the controller’s run() method. Can be modified by reference by a plugin.
… your plugin code …

Output

Teamwork

Plugin code example

PHP

/**
 * 'handlers' => [
 *     'controller_after.tasksTasksInfoAction' => 'controllerAfterTasksTasksInfoAction',
 * ],
 */
public function controllerAfterTasksTasksInfoAction(&$params)
{
    waLog::log(
        sprintf_wp('Task %s has been viewed.', waRequest::get('n')),
        sprintf('tasks/plugins/%s/task_viewed.log', $this->id)
    );
}