SlideShare a Scribd company logo
Framework on Framework - FOF
Rapid application development for the Joomla! CMS
So, what’s that “FOF” thing?
Yeah, I know what you’re thinking
“Oh, dear Lord, not ANOTHER framework!”
FOF uses the Joomla! Platform
It does not completely replace it
Plays along with the other boys
Compatible with Joomla! 2.5, 3.0 and 3.1.
D.R.Y. - Don’t Repeat Yourself
I hate copying/pasting the same code over and over and over and over and over and over and over...
Less is more
Convention over configuration – less time, effort, code and bugs
Flexible, without imposing it’s way of thinking
There are no black boxes. There are methods, plugin events...
Backwards compatibility
There are no quantum, undocumented changes overnight
Some history
How we got here
July 2009 – Base MVC classes
My own classes, extending from JModel & co, minimising copied & pasted code
September 2011 – Turning into a proper framework
Basically, I wanted a RAD framework which doesn’t change every day
October 2011 – Implemented HMVC
while I was stuck on a plane, on the ground, for four hours
May 2012 – First public release
during the J and Beyond 2012 conference
June 2012 – Bootstrap & jQuery
In the optional Akeeba Strapper package
February 2013 – version 2.0 did NOT go into Joomla! 3.1
which is basically something good
March 2013 onwards – Taking off with XML view templates
making it a really Rapid Application Development framework
FOF’s Anatomy
Some general thoughts
Web services. Integrated JSON support and transparent
authentication, opening the door for data provisioning to apps (web,
desktop, mobile,...)
Almost RESTful, not entirely
HMVC components right here, right now, without having to
relearn Joomla! component development, i.e. the exact opposite of the
proposed Joomla! Framework, whenever that’s ready.
Structure
Dispatcher
Controller
Model View
ToolbarHelpers
“triad”
Table
The Dispatcher is the entry point (a.k.a. “router”). It will setup,
run and render the MVC triad.
The Controller is a thin interface to push data to the model state
and instantiate views
The Model is the workhorse. Business logic goes here.
The Table class is a hybrid data adapter, controller and model
(following J!'s convention)
The View fetches model state data and renders them in a
meaningful way
The Toolbar handles the rendering of titles, buttons and so onNon-OOP stuff. Basically, a nice way to say “cruft”
Convention over Configuration
Convention over configuration in
the Dispatcher
The Dispatcher is your component’s router. It routes the request to
the appropriate Controller based on conventions:
A POST request gets routed to the save task
A GET request to a plural view name gets routed to the browse
task
A front-end GET request with an ID gets routed to the read task
A back-end GET request with an ID gets routed to the edit task
Convention over configuration in
Models
Tables are named as #__component_view, e.g. #__todo_items
Auto increment field is named component_view_id, e.g.
todo_item_id
Magic fields: enabled, created_by, created_on, modified_by,
modified_on, locked_by, locked_on, hits
You can override defaults without copying & pasting code, ever.
Copy & paste is the devil!
Convention over configuration in
Controllers
Default tasks (not RESTful!): browse, read, edit, add, delete, save,
apply, ...
Customize with onBeforeMethod and onAfterMethod methods, e.g.
onBeforeSave. Don't copy & paste code.
All MVC objects can be passed a $config array to customize them. It
"flows" from dispatcher to component to model and view.
FOF guesses the task if it's missing based on plural/singular view
name and existence of ID in the query
Convention over configuration in
Views
Views inherit from FOFView and its specialized children, e.g.
FOFViewHtml
Customize using the onTask methods, e.g. onBrowse
The toolbar is handled outside the view, in a FOFToolbar descendant
class. Override it with a toolbar.php file in the component's root.
Magic toolbar methods, e.g. onItemsBrowse allow you to customize
the toolbar without copying & pasting code.
Epic features
HMVC – Hierarchical MVC
Include the results of component views anywhere (other views, other
component, modules, ...)
FOFDispatcher::getTmpInstance(‘com_foobar’, ‘items’, array(‘layout’
=> ‘fancy’))->dispatch();
Reuse view templates
Load a view template from another view, component, ...
echo $this->loadAnyTemplate('site:com_foobar/item/form');
Media files overrides
Load media files like this:
FOFTemplateUtils::addCSS('media://com_foobar/css/frontend.css');
Media overrides are inside the template folder, e.g.
templates/tpl_example/media/com_foobar/css/frontend.css
Web services & automatic JSON
and CSV views
Just add format=json or format=csv
JSON: You have an instant JSON-based remote API for your
components
CSV: You can quickly export whatever you see in the backend to
Excel, Numbers, LibreOffice, Google Docs, etc.
Transparent authentication support using URL parameters or HTTP
Basic Authentication
XML-based views
It’s JForm on double dose of steroids
Browse, read and edit views from XML templates
You don’t need to write any PHP or HTML, but you can mix
traditional PHP-based and XML-based templates, even in the same
view
Overridable with Joomla! template overrides
You can write components with virtually no PHP code at all
Resources
http://github.com/akeeba/fof
Rapid application development with FOF

More Related Content

PPTX
Introduction to building joomla! components using FOF
PPTX
Rapid application development using Akeeba FOF and Joomla 3.2
PDF
How to create a joomla component from scratch
PDF
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...
PPTX
Develop advance joomla! MVC Component for version 3
PPTX
Develop Basic joomla! MVC component for version 3
ODP
Developing new feature in Joomla - Joomladay UK 2016
PDF
Behaviour Driven Development con Behat & Drupal
Introduction to building joomla! components using FOF
Rapid application development using Akeeba FOF and Joomla 3.2
How to create a joomla component from scratch
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...
Develop advance joomla! MVC Component for version 3
Develop Basic joomla! MVC component for version 3
Developing new feature in Joomla - Joomladay UK 2016
Behaviour Driven Development con Behat & Drupal

What's hot (20)

ODP
Problemen oplossen in Joomla - Joomladagen 2014
PPT
Workshop: Symfony2 Intruduction: (Controller, Routing, Model)
PPTX
Custom Template for Joomla! 3
DOCX
How to Develop Your First Ever Joomla Template?
PPTX
Learn How To Develop With CakePHP
ODP
Custom module and theme development in Drupal7
ODT
Easy Blogging With Emacs
PDF
PloneNG: What's new in Plone 4.2, 4.3, and beyond
PDF
Development Setup of B-Translator
PDF
Yii - Next level PHP Framework von Florian Facker
PDF
Joomla Explained - As Easy as 1, 2, 3
PDF
Creating WordPress Theme Faster, Smarter & Without Swearing
KEY
CakePHP 2.0 - It'll rock your world
PPTX
Madison PHP - Getting Started with Magento 2
PDF
Php 7 evolution
PDF
Introduction to CakePHP
PPT
Joomla! Templates and Comparison of Frameworks
PDF
Getting started-with-zend-framework
PPTX
Finding Your Way: Understanding Magento Code
PDF
Creating a Great XPages User Interface, TLCC Teamstudio Webinar - Feb, 2014
Problemen oplossen in Joomla - Joomladagen 2014
Workshop: Symfony2 Intruduction: (Controller, Routing, Model)
Custom Template for Joomla! 3
How to Develop Your First Ever Joomla Template?
Learn How To Develop With CakePHP
Custom module and theme development in Drupal7
Easy Blogging With Emacs
PloneNG: What's new in Plone 4.2, 4.3, and beyond
Development Setup of B-Translator
Yii - Next level PHP Framework von Florian Facker
Joomla Explained - As Easy as 1, 2, 3
Creating WordPress Theme Faster, Smarter & Without Swearing
CakePHP 2.0 - It'll rock your world
Madison PHP - Getting Started with Magento 2
Php 7 evolution
Introduction to CakePHP
Joomla! Templates and Comparison of Frameworks
Getting started-with-zend-framework
Finding Your Way: Understanding Magento Code
Creating a Great XPages User Interface, TLCC Teamstudio Webinar - Feb, 2014
Ad

Similar to Rapid application development with FOF (20)

KEY
FOF Rapid Application Development on Joomla! - Joomla! Day Denmark 2012
PDF
Joomla! Frappe - Κατασκευή εφαρμογών για το Joomla! χωρίς να τραβάτε τα μαλιά...
KEY
JWC - Rapid application development with FOF
PPTX
Rapid application development using Akeeba FOF and Joomla 3.2
PPTX
Get Started with Zend Framework 2
PPTX
Joomla Frameworks Kung Fu
PDF
Intro to ColdBox MVC at Japan CFUG
PPTX
ColdFusion Fw1 (FrameWork1) introduction
PDF
Streamlining Your Applications with Web Frameworks
PPT
Getting Started with Zend Framework
PDF
You need to prepare your vehicle before its transportation
PDF
Joomla!Day Poland 2013 - Joomla Architecture (Ofer Cohen)
PDF
Php and-mvc
PDF
Jab12 - Joomla! architecture revealed
PPT
Joomla Extensions Kung Fu
PPTX
Using MVC with Kentico 8
PPTX
My Very First Zf App Part One
PDF
PHP Hoffman Framework (HMF) at Barcamp Bangkok 2
KEY
Developing Joomla! 1.5 Extensions, Explained
PPT
Howtobuildyourownframework
FOF Rapid Application Development on Joomla! - Joomla! Day Denmark 2012
Joomla! Frappe - Κατασκευή εφαρμογών για το Joomla! χωρίς να τραβάτε τα μαλιά...
JWC - Rapid application development with FOF
Rapid application development using Akeeba FOF and Joomla 3.2
Get Started with Zend Framework 2
Joomla Frameworks Kung Fu
Intro to ColdBox MVC at Japan CFUG
ColdFusion Fw1 (FrameWork1) introduction
Streamlining Your Applications with Web Frameworks
Getting Started with Zend Framework
You need to prepare your vehicle before its transportation
Joomla!Day Poland 2013 - Joomla Architecture (Ofer Cohen)
Php and-mvc
Jab12 - Joomla! architecture revealed
Joomla Extensions Kung Fu
Using MVC with Kentico 8
My Very First Zf App Part One
PHP Hoffman Framework (HMF) at Barcamp Bangkok 2
Developing Joomla! 1.5 Extensions, Explained
Howtobuildyourownframework
Ad

More from Nicholas Dionysopoulos (8)

PDF
Hidden in plain site – joomla! hidden secrets for code monkeys
PDF
Joomla! Security 101 - Joomla! Day Bosnia and Herzegovina 2013
KEY
Advanced Akeeba Backup (Joomla! Day Denmark 2012)
KEY
Joomla! Day Deutschland 2012 - Advanced Akeeba Backup
KEY
Joomla! Day Deutschland 2012 - Active Security
KEY
Joomla! Day Poland 2012 - Monetize your site with Akeeba Subscriptions
KEY
Joomla! Day Poland 2012 - Advanced Akeeba Backup - Beyond just backing up you...
KEY
Joomla! Day Poland 2012 - Active Security for Joomla! sites
Hidden in plain site – joomla! hidden secrets for code monkeys
Joomla! Security 101 - Joomla! Day Bosnia and Herzegovina 2013
Advanced Akeeba Backup (Joomla! Day Denmark 2012)
Joomla! Day Deutschland 2012 - Advanced Akeeba Backup
Joomla! Day Deutschland 2012 - Active Security
Joomla! Day Poland 2012 - Monetize your site with Akeeba Subscriptions
Joomla! Day Poland 2012 - Advanced Akeeba Backup - Beyond just backing up you...
Joomla! Day Poland 2012 - Active Security for Joomla! sites

Recently uploaded (20)

PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
Getting Started with Data Integration: FME Form 101
PPTX
observCloud-Native Containerability and monitoring.pptx
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PPTX
Chapter 5: Probability Theory and Statistics
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Architecture types and enterprise applications.pdf
PPTX
The various Industrial Revolutions .pptx
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PPTX
1. Introduction to Computer Programming.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
2021 HotChips TSMC Packaging Technologies for Chiplets and 3D_0819 publish_pu...
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
project resource management chapter-09.pdf
PDF
Hindi spoken digit analysis for native and non-native speakers
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
Developing a website for English-speaking practice to English as a foreign la...
Getting Started with Data Integration: FME Form 101
observCloud-Native Containerability and monitoring.pptx
gpt5_lecture_notes_comprehensive_20250812015547.pdf
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Chapter 5: Probability Theory and Statistics
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Architecture types and enterprise applications.pdf
The various Industrial Revolutions .pptx
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
1. Introduction to Computer Programming.pptx
Assigned Numbers - 2025 - Bluetooth® Document
2021 HotChips TSMC Packaging Technologies for Chiplets and 3D_0819 publish_pu...
Final SEM Unit 1 for mit wpu at pune .pptx
NewMind AI Weekly Chronicles – August ’25 Week III
NewMind AI Weekly Chronicles - August'25-Week II
Programs and apps: productivity, graphics, security and other tools
project resource management chapter-09.pdf
Hindi spoken digit analysis for native and non-native speakers

Rapid application development with FOF

  • 1. Framework on Framework - FOF Rapid application development for the Joomla! CMS
  • 2. So, what’s that “FOF” thing?
  • 3. Yeah, I know what you’re thinking “Oh, dear Lord, not ANOTHER framework!”
  • 4. FOF uses the Joomla! Platform It does not completely replace it
  • 5. Plays along with the other boys Compatible with Joomla! 2.5, 3.0 and 3.1.
  • 6. D.R.Y. - Don’t Repeat Yourself I hate copying/pasting the same code over and over and over and over and over and over and over...
  • 7. Less is more Convention over configuration – less time, effort, code and bugs
  • 8. Flexible, without imposing it’s way of thinking There are no black boxes. There are methods, plugin events...
  • 9. Backwards compatibility There are no quantum, undocumented changes overnight
  • 11. July 2009 – Base MVC classes My own classes, extending from JModel & co, minimising copied & pasted code
  • 12. September 2011 – Turning into a proper framework Basically, I wanted a RAD framework which doesn’t change every day
  • 13. October 2011 – Implemented HMVC while I was stuck on a plane, on the ground, for four hours
  • 14. May 2012 – First public release during the J and Beyond 2012 conference
  • 15. June 2012 – Bootstrap & jQuery In the optional Akeeba Strapper package
  • 16. February 2013 – version 2.0 did NOT go into Joomla! 3.1 which is basically something good
  • 17. March 2013 onwards – Taking off with XML view templates making it a really Rapid Application Development framework
  • 19. Some general thoughts Web services. Integrated JSON support and transparent authentication, opening the door for data provisioning to apps (web, desktop, mobile,...) Almost RESTful, not entirely HMVC components right here, right now, without having to relearn Joomla! component development, i.e. the exact opposite of the proposed Joomla! Framework, whenever that’s ready.
  • 20. Structure Dispatcher Controller Model View ToolbarHelpers “triad” Table The Dispatcher is the entry point (a.k.a. “router”). It will setup, run and render the MVC triad. The Controller is a thin interface to push data to the model state and instantiate views The Model is the workhorse. Business logic goes here. The Table class is a hybrid data adapter, controller and model (following J!'s convention) The View fetches model state data and renders them in a meaningful way The Toolbar handles the rendering of titles, buttons and so onNon-OOP stuff. Basically, a nice way to say “cruft”
  • 22. Convention over configuration in the Dispatcher The Dispatcher is your component’s router. It routes the request to the appropriate Controller based on conventions: A POST request gets routed to the save task A GET request to a plural view name gets routed to the browse task A front-end GET request with an ID gets routed to the read task A back-end GET request with an ID gets routed to the edit task
  • 23. Convention over configuration in Models Tables are named as #__component_view, e.g. #__todo_items Auto increment field is named component_view_id, e.g. todo_item_id Magic fields: enabled, created_by, created_on, modified_by, modified_on, locked_by, locked_on, hits You can override defaults without copying & pasting code, ever. Copy & paste is the devil!
  • 24. Convention over configuration in Controllers Default tasks (not RESTful!): browse, read, edit, add, delete, save, apply, ... Customize with onBeforeMethod and onAfterMethod methods, e.g. onBeforeSave. Don't copy & paste code. All MVC objects can be passed a $config array to customize them. It "flows" from dispatcher to component to model and view. FOF guesses the task if it's missing based on plural/singular view name and existence of ID in the query
  • 25. Convention over configuration in Views Views inherit from FOFView and its specialized children, e.g. FOFViewHtml Customize using the onTask methods, e.g. onBrowse The toolbar is handled outside the view, in a FOFToolbar descendant class. Override it with a toolbar.php file in the component's root. Magic toolbar methods, e.g. onItemsBrowse allow you to customize the toolbar without copying & pasting code.
  • 27. HMVC – Hierarchical MVC Include the results of component views anywhere (other views, other component, modules, ...) FOFDispatcher::getTmpInstance(‘com_foobar’, ‘items’, array(‘layout’ => ‘fancy’))->dispatch();
  • 28. Reuse view templates Load a view template from another view, component, ... echo $this->loadAnyTemplate('site:com_foobar/item/form');
  • 29. Media files overrides Load media files like this: FOFTemplateUtils::addCSS('media://com_foobar/css/frontend.css'); Media overrides are inside the template folder, e.g. templates/tpl_example/media/com_foobar/css/frontend.css
  • 30. Web services & automatic JSON and CSV views Just add format=json or format=csv JSON: You have an instant JSON-based remote API for your components CSV: You can quickly export whatever you see in the backend to Excel, Numbers, LibreOffice, Google Docs, etc. Transparent authentication support using URL parameters or HTTP Basic Authentication
  • 31. XML-based views It’s JForm on double dose of steroids Browse, read and edit views from XML templates You don’t need to write any PHP or HTML, but you can mix traditional PHP-based and XML-based templates, even in the same view Overridable with Joomla! template overrides You can write components with virtually no PHP code at all