$input->getCmd('task') что такое 'task' в JOOMLA
Я копал этот кусок кода в JOOMLA
$input = JFactory::getApplication()->input;
$controller->execute($input->getCmd('task'));
80% я понял, но застрял в "задании".
Документация говорит, что getCMD
* The default behaviour is fetching variables depending on the
* current request method: GET and HEAD will result in returning
* an entry from $_GET, POST and PUT will result in returning an
* entry from $_POST.
*
* You can force the source by setting the $hash parameter:
*
* post $_POST
* get $_GET
* files $_FILES
* cookie $_COOKIE
* env $_ENV
* server $_SERVER
* method via current $_SERVER['REQUEST_METHOD']
* default $_REQUEST
я просто ищу почти все переменные в сеансе отладки netbeans, но не могу найти переменную задачи.
Теперь мой вопрос: на что указывает эта вещь "задача"? что это представляет?
1 ответ
Решение
В основном задача в Joomla 2.5 представляет функцию в контроллере вашего компонента. Если у вас есть URL-адрес, такой как index.php? Option=com_foo&task=comment.edit, вызывается функция "Edit" в контроллере Comment компонента com_foo.
Например, вот контроллер DPAttachmentsControllerAttachment с функцией загрузки. URL-адрес выглядит как index.php? Option=com_dpattachments&task=attachment.download.
Надеюсь, это то, что вы ищете.