Joomla! Component Creator

Will you have enough ideas ?

Cook

Tutorials

This tutorial explains you how to start coding inside your component.

Level : Intermediate
Size : 14.5 Mo
Duration : 2 hours.

This workshop has been presented in France, and has been translated in english with the precious help of audibleid.

Download the tutorial.

Subject of study :

The main objective is to get on with the N-M relations.
The final component will be able to store the visits (or travels) of a Person (Travellers) to a list of Cities.
Cities, Travellers are simple tables
Travels is a N-M linking the both.
The special gift at the end is a google map integration with JDom (by yourself).


Summary :
  1. Template and JDom
  2. Fields & Forms
  3. Displaying a N-M Relationship
  4. Custom Task
  5. Redirections
  6. N-M Relationship in Grid
  7. Creating a JDom Widget (Google Map)
  8. Using your JDom Widget
Zip files are installs of the component for each chapter.
Before to do Chapter 1, install 'com_travel.1.1.zip'
Before to do Chapter 2, install 'com_travel.1.2.zip'
...
Reinstalling after each chapter is facultative. If you follow well the lesson, you can do the whole component by yourself.

Overview

The component you create is written in a Joomla! standard language. Please refer to the Joomla documentation to understand the source code.
So you don't need other documentation.



Well... It's a joke. ;-)
Of course we prepare you some documentation to help you writting inside your component.

The major points are about our personal touch :

JModel abstraction

★ A component dedicated model class extends the Joomla JModel.
By this way, you can write the common functionnalities for all your component's models. It simplify your job if you want to extends the JModel class.

JController abstraction

★ Same than JModel, a personal class extends the JController class in order to reuse your methods in all controllers instances.
These abstraction classes are the basis to build a personal framework if you want to go deeper.

Calling your datas

★ The models can be called everywhere in your component.
In order to build optimized queries, your model don't always join the tables if you don't need joined datas in context. The SQL calls are optimized to maximum. To answer this, your model is composed by predefined profiles (that correspond to layouts, but not limited to them)

★ The second method to reach your datas is to call your model in the view, then to add some parts in the SQL query (addJoin, addWhere, addSelect...). In seems like the 1.6 way to build the query, but it is applied directly in the model and not on the table object.

★ We made the choice to never build a SQL in other place than in the Model, except the previous point but this is limited to simples add-ons on the query.

★ The model comport itself with modes (publish, filters, accesses, etc...)
When you need, active the modes and the SQL query will intergate them. Don't panic, you'll now be sure to never forget to limit the accesses or to limit query on published elements (for exemple).