【问题标题】:$input->getCmd('task') what is 'task' in JOOMLA$input->getCmd('task') JOOMLA 中的“task”是什么
【发布时间】:2013-10-12 06:35:39
【问题描述】:

我在 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 调试会话中搜索几乎所有变量,但找不到任务变量。

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

【问题讨论】:

    标签: joomla joomla2.5 joomla-extensions joomla-component


    【解决方案1】:

    基本上,joomla 2.5 中的任务代表组件控制器中的功能。当您有一个类似 index.php?option=com_foo&task=comment.edit 的 url 时,将调用组件 com_foo 的控制器 Comment 中的函数“Edit”。

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

    希望这是您正在寻找的。​​p>

    【讨论】:

    • 任务不是也需要一个显示视图之间的过程吗?换句话说,用户在从一个视图跳到另一个视图时不会意识到正在发生的任务?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-12
    • 1970-01-01
    • 1970-01-01
    • 2016-10-05
    相关资源
    最近更新 更多