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

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"

If the data is coming from the database, we should always think about using the
sql element; this is a very generic element, which allows us to create a select list
based on a database query.
When we create new JElement subclasses, we must follow some specific naming
conventions. JElement subclasses are named after the element type and prefixed with
the word JElement. The class is stored in a separate file named after the element type.
The file is in the elements folder in the component's administrative root.
Imagine we want to create a new element type, menus. The class would be called
JElementMenus and be located in the file menus.php. The class needs to extend the
core JElement class; we do not need to import the joomla.html.parameter.element
library because the JParameter class does this atomically when it loads JElements.
In order to build the class, we need to decide on the XML we are going to use
to define a JElementMenus parameter. This element is very similar to the lists
element so we may as well use a similar structure.


Pages:
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144