These are used to enqueue a message.
This example redirects us, as per the previous example, and enqueues a notice type
message that will be displayed after the redirect has successfully completed:
$mainframe->redirect('index.php?option=com_example', 'Some Message',
'notice');
The final parameter, the message type, defaults to message.
The application redirect() method immediately enqueues the
optional message, redirects the user's browser, and ends the application.
The more common mechanism for implementing redirects is to use the JController
setRedirect() method. We generally use this from within a controller method
that handles a task, but because the method is public we can use it outside of
the controller.
This example, assuming we are in a method in a JController subclass, will set the
controller redirect to index.php?option=com_example:
$this->setRedirect('index.php?option=com_example');
??? ??? ??? ??? ??? ???
Customizing the Page
[ 248 ]
As with the application redirect() method, there are two additional optional
parameters that we can provide when using this method.
Pages:
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342