Back to BaseController class

Method registerTask

public static
registerTask
(mixed $task, mixed $method)
Register (map) a task to a method in the class.
Parameters
  • string $task The task.
  • string $method The name of the method in the derived class to perform for this task.
Returns
  • static A \JControllerLegacy object to support chaining.
Since
  • 3.0

Method registerTask - Source code

/**
 * Register (map) a task to a method in the class.
 *
 * @param   string  $task    The task.
 * @param   string  $method  The name of the method in the derived class to perform for this task.
 *
 * @return  static  A \JControllerLegacy object to support chaining.
 *
 * @since   3.0
 */
public function registerTask($task, $method)
{
    if (\in_array(strtolower($method), $this->methods)) {
        $this->taskMap[strtolower($task)] = $method;
    }
    return $this;
}