This means that we will probably ever use only one parameter with the
enqueueMessage() method. However, it is possible to add messages of other types.
This is an example of how we would add a message of type bespoke:
$mainframe->enqueueMessage('A bespoke type message', 'bespoke');
Messages of other types will render in the same format as message type messages.
Imagine we want to use the bespoke message type to render messages but not
display them. This could be useful for debugging purposes.
This example demonstrates how we can add a CSS Declaration to the document,
using the methods, described earlier in the chapter, to modify the way in which the
bespoke messages are displayed:
$css = '/* Bespoke Error Messages */
#system-message dt.bespoke
{
display: none;
}
dl#system-message dd.bespoke ul
{
color: #30A427;
border-top: 3px solid #94CA8D;
border-bottom: 3px solid #94CA8D;
background: #C8DEC7 url(notice-bespoke.png) 4px 4px no-repeat;
}';
$doc =& JFactory::getDocument();
$doc->addStyleDeclaration($css);
Now when bespoke messages are rendered, they will appear like this:
Chapter 9
[ 245 ]
Redirects
Redirection allows us to redirect the browser to a new location.
Pages:
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337