Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何删除joomla 2.5中已排队的消息?_Joomla_Joomla2.5 - Fatal编程技术网

如何删除joomla 2.5中已排队的消息?

如何删除joomla 2.5中已排队的消息?,joomla,joomla2.5,Joomla,Joomla2.5,如何删除joomla 2.5中已排队的消息? 提前谢谢 我试过了 $jAp = JFactory::getApplication(); $messagesexist = $jAp->getMessageQueue(); 但是上面的代码显示了所有被请求的消息。 我想从中删除特定的消息。试试这个 $session = JFactory::getSession(); $sessionQueue = $session->get

如何删除joomla 2.5中已排队的消息? 提前谢谢

我试过了

$jAp = JFactory::getApplication();
$messagesexist = $jAp->getMessageQueue();
但是上面的代码显示了所有被请求的消息。 我想从中删除特定的消息。

试试这个

                $session = JFactory::getSession();
                $sessionQueue = $session->get('application.queue');
                if (count($sessionQueue)) {
                        $session->set('application.queue', null);
                }

希望它能工作。

要删除特定消息,您必须通过
getMessageQueue()
返回的
数组

比如说:

// Get the message queue
$messages = JFactory::getApplication()->getMessageQueue();

// If we have messages
if (is_array($messages) && count($messages))
{
    // Check each message for the one we want
    foreach ($messages as $message)
    {
        // do your checks here
    }
}

来自什么的排队消息?组件?如果有,是哪一部分?您已经尝试过什么?是的,它来自componentTry在控制器中查找组件的特定视图。您很可能会看到如下内容:
$message=JText::(('LANG_STRING')
后跟
$this->setRedirect($url、$message、$messageType)