joomla framework tour
DESCRIPTION
Louis Landry's slides about the Joomla! Framework for a presentation to Joomla! Summer of Code Students.TRANSCRIPT
![Page 1: Joomla Framework Tour](https://reader035.vdocuments.us/reader035/viewer/2022062404/5528136b55034617648b4626/html5/thumbnails/1.jpg)
Joomla! Framework 101
A Virtual Tour
![Page 2: Joomla Framework Tour](https://reader035.vdocuments.us/reader035/viewer/2022062404/5528136b55034617648b4626/html5/thumbnails/2.jpg)
Methods to Remember
jimport(‘dot.separated.path.to.library’);
JText::_(‘String_To_Translate’);
JRoute::_(‘index.php?option=com_foo&...’);
Everything in the JFactory class
JFactory::getDBO()
JFactory::getDocument()
JFactory::getUser() , etc.
![Page 3: Joomla Framework Tour](https://reader035.vdocuments.us/reader035/viewer/2022062404/5528136b55034617648b4626/html5/thumbnails/3.jpg)
The Most Important Packages
Application
Database
Document
Environment
Html
![Page 4: Joomla Framework Tour](https://reader035.vdocuments.us/reader035/viewer/2022062404/5528136b55034617648b4626/html5/thumbnails/4.jpg)
The Application Package
Model-View-Controller libraries
Application library
Menu library
Module and Component helper libraries.
![Page 5: Joomla Framework Tour](https://reader035.vdocuments.us/reader035/viewer/2022062404/5528136b55034617648b4626/html5/thumbnails/5.jpg)
Model-View-Controller
Controller manages the request
Two principle request types
View based -- GET
Task based -- POST
Controllers choose and instantiate Models and Views for the request
![Page 6: Joomla Framework Tour](https://reader035.vdocuments.us/reader035/viewer/2022062404/5528136b55034617648b4626/html5/thumbnails/6.jpg)
Model-View-Controller
Models manage data
Models strive to be request agnostic
Views manage presentation
Views get data from Models through get()
eg. $this->get(‘List’); calls MyModel::getList();
Views include layouts to render output
![Page 7: Joomla Framework Tour](https://reader035.vdocuments.us/reader035/viewer/2022062404/5528136b55034617648b4626/html5/thumbnails/7.jpg)
Application Library
Application object is at the center of Joomla
Loads configuration
Initializes session
Routes request
Executes component
Renders document
![Page 8: Joomla Framework Tour](https://reader035.vdocuments.us/reader035/viewer/2022062404/5528136b55034617648b4626/html5/thumbnails/8.jpg)
Database Package
Database library
Simple and lightweight
Sanitize data before insert or update
Always check for errors
![Page 9: Joomla Framework Tour](https://reader035.vdocuments.us/reader035/viewer/2022062404/5528136b55034617648b4626/html5/thumbnails/9.jpg)
Database Package
Table library
Encapsulates a database table/row
Add your own with: JTable::addIncludePath(‘/path/to/files/’);
Provides some basic features common to Joomla related tables
Always implement the check() method
![Page 10: Joomla Framework Tour](https://reader035.vdocuments.us/reader035/viewer/2022062404/5528136b55034617648b4626/html5/thumbnails/10.jpg)
Document Package
Document library encapsulates all output to the browser
Several document types
HTML is default
RAW is magic
view.html.php - view.feed.php - view.csv.php
![Page 11: Joomla Framework Tour](https://reader035.vdocuments.us/reader035/viewer/2022062404/5528136b55034617648b4626/html5/thumbnails/11.jpg)
Environment Package
Browser library detects browser
Request library is your friend
Filters data based on what you need
Integers, words, floats, paths, etc.
Response library handles headers and body
URI library allows manipulation and detection
![Page 12: Joomla Framework Tour](https://reader035.vdocuments.us/reader035/viewer/2022062404/5528136b55034617648b4626/html5/thumbnails/12.jpg)
HTML Package
HTML goes in layouts
HTML goes in layouts
HTML goes in layouts
HTML goes in layouts
HTML goes in layouts
HTML goes in layouts
![Page 13: Joomla Framework Tour](https://reader035.vdocuments.us/reader035/viewer/2022062404/5528136b55034617648b4626/html5/thumbnails/13.jpg)
HTML Package
JHtml::_(‘{CLASS}.{METHOD}’, $arg1, ...);
Add your own with: JHtml::addIncludePath(‘/path/to/files’);
Editor library
Pagination library
Pane library
![Page 14: Joomla Framework Tour](https://reader035.vdocuments.us/reader035/viewer/2022062404/5528136b55034617648b4626/html5/thumbnails/14.jpg)
The Rest of the Packages
Base
Cache
Client
Error
Event
![Page 15: Joomla Framework Tour](https://reader035.vdocuments.us/reader035/viewer/2022062404/5528136b55034617648b4626/html5/thumbnails/15.jpg)
The Rest of the Packages
Filesystem
Filter
Installer
Language
![Page 16: Joomla Framework Tour](https://reader035.vdocuments.us/reader035/viewer/2022062404/5528136b55034617648b4626/html5/thumbnails/16.jpg)
The Rest of the Packages
Plugin
Registry
Session
Template
User
Utilities