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

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"

Occasionally there are times when we do not need to
override the display method. For example if we were outputting static content.
The diagram we looked at earlier, which showed how the three classes??”JModel,
JView, and JController??”relate to one another, describes an aggregate relationship
between views and models. That is to say, within a view there can be references to
model objects. In our case, there is a reference to a MyextensionModelFoobar object.
Going back to our example: the JView get() method looks at all the different
models with which it is familiar and looks for a method named the same as the first
parameter of the get() call and prefixed with get. So when we use $this->
get('Foobar') we are asking the view to find a model with a method called
getFoobar(), to execute the method, and to return the result.
Slightly confusing is how we ended up with a reference to a
MyextensionModelFoobar object; because our view is called
MyextensionViewFoobar, a controller would know that these two classes relate to
one another (both are named Foobar).


Pages:
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114