SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 114 | Next

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"

In the above example we get
the controller class file, instantiate a new controller, execute the task, and redirect the
browser. The redirect() method will only redirect the browser if a redirect URI has
been set; use setRedirect() to set a redirect URI and, optionally, a message.
We can do far more with these files if we wish, but often we do not need to;
generally, it is better to keep the processing encapsulated in controllers.
It is common practice to use multiple controllers, one for each entity. These are
generally stored in a folder called controllers in files named after the entity. Each
controller class is named after the entity and prefixed with MyextensionController.
When we use multiple controllers, we generally use the URI query request value c
to determine the controller to instantiate. This demonstrates how we can deal with
multiple controllers:
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted Access');
// get the base controller
require_once(JPATH_COMPONENT.


Pages:
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126