16
Joomla! Framework 101 A Virtual Tour

Joomla Framework Tour

  • Upload
    joomla

  • View
    1.517

  • Download
    8

Embed Size (px)

DESCRIPTION

Louis Landry's slides about the Joomla! Framework for a presentation to Joomla! Summer of Code Students.

Citation preview

Page 1: Joomla Framework Tour

Joomla! Framework 101

A Virtual Tour

Page 2: Joomla Framework Tour

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

The Most Important Packages

Application

Database

Document

Environment

Html

Page 4: Joomla Framework Tour

The Application Package

Model-View-Controller libraries

Application library

Menu library

Module and Component helper libraries.

Page 5: Joomla Framework Tour

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

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

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

Database Package

Database library

Simple and lightweight

Sanitize data before insert or update

Always check for errors

Page 9: Joomla Framework Tour

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

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

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

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

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

The Rest of the Packages

Base

Cache

Client

Error

Event

Page 15: Joomla Framework Tour

The Rest of the Packages

Filesystem

Filter

Installer

Language

Mail

Page 16: Joomla Framework Tour

The Rest of the Packages

Plugin

Registry

Session

Template

User

Utilities