Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword or section
Like this
133Activity
0 of .
Results for:
No results containing your search query
P. 1
Joomla Component Development PDF

Joomla Component Development PDF

Ratings:

4.5

(6)
|Views: 26,315|Likes:
Published by Prabhu
This document guide you to build your own component in joomla from scratch - Prabhu Patil.
This document guide you to build your own component in joomla from scratch - Prabhu Patil.

More info:

Published by: Prabhu on Jul 22, 2009
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

01/01/2013

pdf

text

original

 
 Joomla Component Development.
Confidential
– All rights reserved.
1
 JoomlaComponent Development
 
Author Prepared On Revision Approved By
Prabhu Patil 18
th
January, 2009
This document is solely meant for internal use of the designated programmers at “Carmel”development center and is classified as highly confidential. Please ensure that you don’tleave copies of this document on your local disk drives or circulate in any form withoutexplicit permission.
The only controlled copy of this document is the on-line version maintained on VSS server. It isthe user's responsibility to ensure that any copy of the controlled version is current and complete,and that the obsolete copies are discarded.
 
 Joomla Component Development.
Confidential
– All rights reserved.
2
Table of Content
Introduction:.............................................................................................................................3Section 1: The components' table in joomla's database........................................................4Section 2: The entry point.......................................................................................................5Section 3 – The backend tasks –The default task..................................................................8Section 3.1 the default controller task (
display
)................................................................8Section 3.2 The model - Getting the students from the DB............................................12The code here it is (Model):.........................................................................................13Section 3.3 - The view - Listing the students..................................................................24Here’s the view code (list):...........................................................................................24Here it is: the view’s layout/template..........................................................................29Section 4 – The backend tasks – The edit task....................................................................37Section 4.1 – The controller task: edit.............................................................................37Code for edit method:...................................................................................................37Section 4.2 The model – Getting a student through its
id 
...............................................38Section 4.3 The view – form to edit the student..............................................................38Section 5: The backend tasks - Save....................................................................................46Section 5.1 – The controller task:
save
............................................................................46Here’s the code (save() method in studentsController.php):......................................46Here is the Code (saveStudent($student) method in …/models/students.php).........46Section 5.2 JTABLE.........................................................................................................48Section 5.3 The Model – Adding the
save
functionality................................................50Here is the Code (saveStudent($student) method in …/models/students.php).........50Section 6: The backend tasks – The add task......................................................................52Section 6.1: The controller task:
add 
...............................................................................52Here’s the add() function in controller code:..............................................................52Section 6.2: The view - Form to edit the student (revisited)..........................................52Here’s the displayAdd() method in view.php code:...................................................53Section 6.3: The model – New students...........................................................................53Here’s the getNewStudent() ..//models/students.php code:........................................53Section 7: The backend tasks: The
remove
task..................................................................55Section 7.1: The controller task: remove.........................................................................55Here is remove() method code in studentsController.php..........................................55Section 7.2: The model – Deleting students....................................................................55Here is the deleteStudents() in ..//models/students.php..............................................55Section 8: Installation............................................................................................................58TEST:.................................................................................................................................58
 
 Joomla Component Development.
Confidential
– All rights reserved.
3
 Component Development with Example: TheBackend
Introduction:
This document is about a Joomla component named "Students" that manage our StudentsList, Add, Edit and Remove feature. This new version of Joomla (1.5) uses an approachto component development based on the
Model-View-Component
design pattern.So what is this of the Model View Controller pattern? Well, if you look for it in this book “Design patterns – Elements of Reusable Object Oriented Software” (Erich Gamma, etall), which is probably the most popular book about design patterns, you’ll find this:“MVC consists of three kinds of objects. The Model is the application object, the View isits screen presentation, and the Controller defines the way that the user interface reacts tothe user input. Before MVC user interface designs tended to lump these objectstogether…”So the basic idea is that you have a Model of your data, that is unaware of the views thatmight exists to represent it, you have one or more views of that model that represent it,and you have a controller, which is responsible for receiving input from the views andupdating the model. For creating our Joomla component we’ll have to write a model, aview and a controller for itWe have to do the backend, which will allow us to manage our Students: List, Add, Editand Remove them.

Activity (133)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->