Xtremax - Web Design

20 Mar, 2009

Inside Joomla MVC Part 3

Posted by: Mr Cheetah In: test category

Fill in the blanks – where to start and how to do them

1. Entry Point

The entry point of each component is standard:

[COMPONENT_NAME].php

and for backend modules, it is also possible to use

admin.[COMPONENT_NAME].php

to be the entry point.

The purpose of the entry point is very simple, initiate the correct controller and execute the task. See below for a very typical entry point file:

image

Another important function for the entry point file is to register any path for any JTable, JModel that are not in standard location, or not in standard file names, for example, when you want to have JTables to be places in the front end component:

JTable::addIncludePath(JPATH_COMPONENT.DS.’tables’);

This “addIncludePath” method is available for both JTable and JModel, but please do not mix up.

For JModel, alternatively, the search path can be added by calling JController::addModelPath method, but eventually, it is still done by  calling the JModel::addIncludePath.

 

2. Toolbars

For backend module, it is advisable to follow the Joomla default UI configuration, in this way, users are presented with a consistent UI experience, prevent mistakes and reduce training complexity.

One of the key features of Joomla backend UI is its Toolbar:

image

To program this, actually it is quite easy, especially if you are using the common toolbar tasks like:

  • save
  • add
  • delete
  • publish
  • preferences

We do not even need to specify the icon to be used. The complete list of methods available are listed below:

image

We can see for many of the methods, there are 2 different version: one with ‘X’ and one without ‘X’. What is the difference?

For the versions with an “X” in the end, the official comment says something like this:

Extended version of *** calling hideMainMenu() before submitbutton().

Hiding the menu prevents the page from being navigate away easily in doing the task, and gives people a “transaction” kind of feeling.

What happen is, all the buttons represent a “task” in your controller, upon clicked, the task will be “executed” on the specific controller.

How should we use the JToolBarHelper class? TO BE CONTINUED.

Bookmark and Share

2 Responses to "Inside Joomla MVC Part 3"

1 | amar

May 6th, 2009 at 2:35 pm

Avatar

i want to help MVC code debug..

bhanu.amar@gmail.com

2 | Craigslist Proxy

June 7th, 2009 at 2:42 pm

Avatar

Insightful read. I have stumbled and twittered this for my friends. Others no doubt will like it like I did.

Comment Form

Xtremax Web Design Portfolio

    Opera Estate Primary SchoolNational Association of Travel Agents SingaporeFUMIYAMA CORPORATIONEngineering Education PortalBOON HI-TECH SUPERSTORESingapore Tourism Board

About Xtremax

This is all about a group of hard-core web developers who go about rambling about their daily efforts to make the internet world a better and more accessible place.