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

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"

In Joomla!, to help separate out the
presentation we also have templates within components.
Templates are PHP files that mainly consist of XHTML and include small snippets
of PHP to output data. Although there are no strict conventions on the way in which
we use our templates, there are some common rules that we normally observe:
Do not process data
Use colon and endX in preference of curly braces
Encapsulate each line of PHP in its own PHP tags
Keep tag IDs lowercase and use underscore word separators
Indent for the XHTML, not the PHP
This example shows a very basic template that demonstrates each of the rules:

items as $item) : ?>

name; ?>



??? ??? ??? ??? ???
Chapter 8
[ 213 ]
Take particular note of the use of the colon to denote the start of the foreach block,
and endforeach to denote the end of the block. Using this alternative syntax makes
templates easier to read; just imagine hunting for the correct ending curly brace in a
large template file!
You almost certainly noticed the use of $this in the example template.


Pages:
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295
druga wojna światowa Free English grammar and study guid hotel jelenia góra Russian bride counter strike 1.6