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 94 | Next

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"


Component Design
[ 70 ]
The controller selects the models with which the request is concerned and performs
any required data modifications. The controller determines the view to use and
associates the models with the view. In some cases, a view will not be required and a
redirect will be initiated instead.
The controller executes the action and either redirects the browser or displays data.
When displaying data the controller creates a view and optionally associates one or
more models with the view
Building a Model
Before we start building a model, we need to determine the name of the model.
To make the MVC work as intended, we follow a special naming convention: the
component's name, the word Model, the data entity name. The model must be in a
file named after the entity and be located in the models folder.
Imagine we are creating a model for the component 'My Extension' and the entity
data is called foobar. The model class would be called MyextensionModelFoobar
and it would be located in models/foobar.


Pages:
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106