API17

Difference between revisions of "JApplication::enqueueMessage"

From Joomla! Documentation

(Added "Examples")
(→‎Examples: added frontent example)
Line 46: Line 46:
 
===Examples===
 
===Examples===
  
To enqueue a message (in the module) for a administration/backend component:
+
To enqueue a message (in a module) for a administration/backend component:
 
<source lang="php">
 
<source lang="php">
$this->_mainframe->enqueueMessage('LoremImpsum');
+
$this->_mainframe->enqueueMessage('YOUR MESSAGE GOES HERE', 'message');
 
</source>
 
</source>
  
 +
To enqueue a message (in a module) for a website/frontent component:
 +
<source lang="php">
 +
JFactory::getApplication()->enqueueMessage('YOUR MESSAGE GOES HERE', 'message');
 +
</source>
  
 
===User contributed notes===
 
===User contributed notes===

Revision as of 01:59, 23 June 2012

The "API17" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Joomla 11.1 JApplication::enqueueMessage[edit]

Description[edit]

Enqueue a system message.

Template:Description:JApplication::enqueueMessage [Edit Descripton]

public function enqueueMessage (
        $msg
        $type= 'message'
)
Parameter Type Default Description
$msg string The message to enqueue.
$type string 'message' The message type.
  • Returns void
  • Defined on line 390 of libraries/joomla/application/application.php
  • Since Joomla 11.1

See also[edit]

Template:SeeAlso:JApplication::enqueueMessage [Edit See Also]

Examples[edit]

To enqueue a message (in a module) for a administration/backend component:

$this->_mainframe->enqueueMessage('YOUR MESSAGE GOES HERE', 'message');

To enqueue a message (in a module) for a website/frontent component:

JFactory::getApplication()->enqueueMessage('YOUR MESSAGE GOES HERE', 'message');

User contributed notes[edit]

<CodeExamplesForm />