$ input-> getCmd('task')JOOMLA中的'task'是什么

ars*_*lan 3 joomla joomla-extensions joomla-component joomla2.5

我在JOOMLA挖掘这段代码

$input = JFactory::getApplication()->input;
$controller->execute($input->getCmd('task'));
Run Code Online (Sandbox Code Playgroud)

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
Run Code Online (Sandbox Code Playgroud)

我只搜索netbeans调试会话中的几乎所有变量,但无法找到任务变量.

现在我的问题是这个"任务"指向的是什么?它代表什么?

Lao*_*neo 7

基本上,joomla 2.5中的任务代表组件控制器中的一个功能.当你有一个像index.php?option = com_foo&task = comment.edit这样的url时,控制器中的函数"Edit"会调用组件com_foo的注释.

例如,这里是一个带有下载功能 的控制器DPAttachmentsControllerAttachment.这个url看起来像index.php?option = com_dpattachments&task = attachment.download.

希望这是你正在寻找的.