I am looking for a way to build multiple task with 1 layout/view

for example:

administrator/index.php?option=com_component&task=form.one administrator/index.php?option=com_component&task=form.tow

what i need is that from any task i can build the same form with different parameters


1 Answer 1


Joomla MVC works based on task parameter, following a CMD string pattern. In this way, it can be associated with a controller/task.

A task array is not standard parameter, and Joomla MVC is not going to accept it, or call several tasks to compose a final output.

Tasks are executed by JControllerLegacy in this way:

public function execute($task)
    $this->task = $task;

    $task = strtolower($task);
    if (isset($this->taskMap[$task]))
        $doTask = $this->taskMap[$task];
    elseif (isset($this->taskMap['__default']))
        $doTask = $this->taskMap['__default'];
        throw new Exception(JText::sprintf('JLIB_APPLICATION_ERROR_TASK_NOT_FOUND', $task), 404);

    // Record the actual task being fired
    $this->doTask = $doTask;

    return $this->$doTask();

In theory, you can override all JController methods to override the default task execution, and create your own processing. Or, you can just add a new parameter mytask, and manage mytask in your own way to avoid any conflict.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.