gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-01 23:13:30 25 4
gpt4 key购买 nike

我在 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 调试 session 中的几乎所有变量,但无法找到任务变量。

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

最佳答案

基本上,joomla 2.5 中的任务代表组件 Controller 中的功能。当你有一个像 index.php?option=com_foo&task=comment.edit 这样的 url 时,调用组件 com_foo 的 Controller 注释中的函数“编辑”。

例如,这里有一个带有 download function 的 Controller DPAttachmentsControllerAttachment该网址看起来像 index.php?option=com_dpattachments&task=attachment.download。

希望这就是您要找的。

关于joomla - $input->getCmd ('task' ) JOOMLA 中的 'task' 是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19195163/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com