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

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"

When we use a controller to display a view it
automatically attempts to root out a related model and, if it finds one, assigns it to
the view. We will explain this in slightly more detail when we cover controllers.
Chapter 4
[ 77 ]
In our case the getFoobar() method in the MyextensionModelFoobar class returns
a stdClass object (stdClass is a PHP class). Once we have this data, we can assign
it to our view ready to be used by our layout (template). We assign data to our view
because it makes it very easy to access from within a layout. We need not do this if
we are not using layouts to present our view.
There are two ways in which we can assign data to our view: we can use the
assign() or assignRef() method. The two methods are very similar, except that
assignRef() assigns a reference to the data and assign() assigns a copy of the
data. For both methods, the first parameter is the name of the data and the second
parameter is the data itself.
There is another way in which the assign() method can be used, which is similar to
a bind function.


Pages:
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6