SlideShare ist ein Scribd-Unternehmen logo
1 von 62
Introduction to building Joomla!
components using FOF
Presented at J and Beyond 2014
Tim Plummer
FOF = Framework on Framework
What is FOF?
• Rapid application development
framework for Joomla
• Not standalone – it extends
Joomla
• Aim to not break backwards
compatibility without a clear
deprecation and migration
path.
Who made FOF?
• Created by Nicholas Dionysopoulos
• Now over 31 contributors
Why FOF?
• Learn how to create components quickly and
easily with very little code
• Since Joomla 3.2, FOF has been included in
the core
You can read about why this happened at:
https://groups.google.com/forum/#!topic/frameworkonframework/VxxIKvTooXU
How FOF became F0F (F zero F)
FOF vs F0F
• All class prefixes changed from FOF to F0F (the
letter O was changed to number 0) to avoid
naming conflicts with Joomla!'s outdated copy
of FOF
FOF vs F0F
• Joomla v3.3.0 includes FOF v2.2.1. This is the
last version included in Joomla v3 series until a
future Joomla v4
• New F0F v2.3.0, all extensions must have an
installer with the new library
What’s happening with FOF?
• The version shipped with Joomla is no longer
maintained
• It will not be removed until Joomla 4.0. We
are not going to break existing extensions.
• Recommended to use F0F instead (you must
include logic to install it with your extension)
https://groups.google.com/forum/#!topic/joomla-dev-cms/_HaeK8-33dk
Future of F0F?
• F0F isn’t dying, it’s actively maintained.
• The bigger goal for [Nicholas] is having F0F as a
RAD framework for Joomla! and AWF as the more
powerful framework that goes beyond just
Joomla!
• AWF is a framework designed to create single-
source applications that can run standalone, as a
native Joomla! component and as a native
WordPress plugin (conceivably also as a native
Drupal module)
Key Dates
• May 2012 – First public release
• June 2012 – Bootstrap & jQuery
• March 2013 – XML view templates
• September 2013 – Added to Joomla 3.2 core
• May 2014 - F0F fork
Benefits
• Less code = less bugs
• Less code = quicker to develop
• Automagic stuff to make your life easier
F0F System Requirements
• Joomla 2.5.6 or greater
• PHP 5.3.3
Convention over
configuration
• Use the FOF naming conventions and you get
functionality for free
Key Features
• Reuse views while respecting template
overrides – loadAnyTemplate() allows you to
load any view
• Media files overrides – effectively create
template overrides for css and js files
• Automatic JSON and CSV in views
– Just add format=json or format=csv
• XML-based views
– You can mix PHP-based and XML-based templates
Magic Fields
• Just add to your database table and all these just
magically work and implement required
functionality
– enabled (like state or published)
– created_by
– created_on (like created)
– modified_by
– modified_on (like modified)
– locked_by (like checked_out)
– locked_on (like checked_out_time)
– hits
NOW LET’S LOOK AT AN
EXAMPLE
What are we going to make?
• Simple timesheet application com_timesheet
will be used to demonstrate some F0F features
Source code
You can access all source code shown today via
https://github.com/tuum/com_timesheet
Database
CREATE TABLE IF NOT EXISTS `#__timesheet_items` (
`timesheet_item_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`slug` varchar(50) NOT NULL,
PRIMARY KEY (`timesheet_item_id`)
) DEFAULT CHARSET=utf8;
/administrator/components/com_timesheet/sql/install/mysql/install.sql
component name view name (plural)
view name (singular)
id field as per above
*Note, final table has more fields, this is just demonstrating naming standards
Entry Point
<?php
defined('_JEXEC') or die();
// Load FOF
include_once JPATH_LIBRARIES.'/f0f/include.php';
if(!defined('F0F_INCLUDED')) {
JError::raiseError ('500', 'FOF is not installed');
return;
}
F0FDispatcher::getTmpInstance('com_timesheet')->dispatch();
/administrator/components/com_timesheet/timesheet.php
component name
Dispatcher
<?xml version="1.0" encoding="UTF-8"?>
<fof>
<!-- Component back-end options -->
<backend>
<!-- Dispatcher options -->
<dispatcher>
<option name="default_view">cpanels</option>
</dispatcher>
</backend>
</fof>
/administrator/components/com_timesheet/fof.xml
default view
Dispatcher
• Also using PHP dispatcher to load Akeeba
Strapper
• Could use this to define default view if you
wanted
/administrator/components/com_timesheet/dispatcher.php
Installation XML
• Aka XML Manifest
• Just like a normal Joomla component
/administrator/components/com_timesheet/com_timesheet.xml
Config
• Just like a normal Joomla component
/administrator/components/com_timesheet/config.xml
Access
• Just like a normal Joomla component
/administrator/components/com_timesheet/access.xml
View files
• browse – list page
default.php or form.default.xml
• edit – edit page
form.php or form.form.xml
• read – show single record without being able to
edit
item.php or form.item.xml
List view
List view
• Each column has a header
<header name="title" type="fieldsearchable" sortable="true"
buttons="no" buttonclass="btn"
/>
<field name="title" type="text"
show_link="true"
url="index.php?option=com_timesheet&amp;view=category&amp;id=[ITEM:ID]"
/>
and a field
List view
• Want to make a column sortable? Just add
sortable="true“ to header
Form
Form
<?xml version="1.0" encoding="utf-8"?>
<form validate="true">
<fieldset name="basic_configuration"
label="COM_TIMESHEET_CATEGORIES_GROUP_BASIC"
>
<field name="title" type="text"
label="COM_TIMESHEET_CATEGORIES_FIELD_CATEGORY_TITLE_LABEL"
description="COM_TIMESHEET_CATEGORIES_FIELD_CATEGORY_TITLE_DESC"
class="input-xlarge hasTooltip"
required="true"
/>
</fieldset>
</form>
*Note, final XML file has more fields
Cpanel view icons
<div class=icon>
<a href="index.php?option=com_timesheet&view=categories">
<div class="timesheet-icon-category"> </div>
<span><?php echo JText::_('COM_TIMESHEET_TITLE_CATEGORIES');
?></span>
</a>
</div>
/administrator/components/com_timesheet/views/cpanels/tmpl/default.php
Cpanel view icons
.timesheet-icon-item {
background:
url("../../../media/com_timesheet/images/timesheet_icon.png") no-
repeat scroll left top transparent;
display: block;
height: 32px;
margin: 4px auto 6px;
overflow: hidden;
text-indent: -99999px;
width: 32px;
}
/media/com_timesheet/css/backend.css
Version specific view
• For example, you may wish to
move location of ordering column
in Joomla 2.5 vs Joomla 3
Version specific view
• FOF will automatically search for view template
files (or XML forms) suffixed with the Joomla!
version family or version number
• Joomla! 2.5
– default.j25.php, default.j2.php and default.php
• Joomla! 3.2
– default.j32.php, default.j3.php and default.php
• Also applies to XML forms
– form.default.j25.xml, form.default.j2.xml
Mix and match PHP with
XML
For example, you may wish to style the select
Mix and match PHP with
XML
<?php
defined('_JEXEC') or die();
if (version_compare(JVERSION, '3.0.0', 'gt'))
{
JHtml::_('formbehavior.chosen', 'select');
}
$viewTemplate = $this->getRenderedForm();
echo $viewTemplate;
This bit loads the XML file
Add toolbar buttons
public function onCategoriesBrowse()
{
$this->onBrowse();
JToolBarHelper::divider();
JToolbarHelper::back('JTOOLBAR_BACK','index.php?option=co
m_timesheet&view=cpanels');
}
/administrator/components/com_timesheet/toolbar.php
CSV format
• Append &format=csv to any view
index.php?option=com_timesheet&view=categories&format=csv
JSON format
• Append &format=json to any view
index.php?option=com_timesheet&view=categories&format=json
Front end
<?php
defined('_JEXEC') or die();
echo $this->loadAnyTemplate('admin:com_timesheet/item/form');
Note loadAnyTemplate() is better than include() or require() as it respects template
overrides
Could be site to load front end view
Can load one of the backend views using
loadAnyTemplate
Front end
<?php
defined('_JEXEC') or die();
echo $this->getRenderedForm();
F0F is smart enough to figure out that if you don’t
have XML file in front end, look for view with same
name in backend
Front end toolbar
public function onItemsAdd()
{
//show toolbar on front end
$this->renderFrontendButtons = true;
parent::onAdd();
}
/administrator/components/com_timesheet/toolbar.php
Automatic language loading
• FOF automatically loads component language
files (frontend and backend)
• English loads first, then site/user language
loads next and overrides English
Media file overrides
• /templates/yourtemplate/media/ (not the
HTML folder)
• Can effectively create template overrides for
CSS and Javascript files.
Installation script
• F0FUtilsInstallscript makes it much easier to
install F0F and Akeeba Strapper
/administrator/components/com_timesheet/file.script.php
Installation Package
Backend
Front end
Language
Media
Demo time…
Now you are ready to start creating
your own components with FOF
Resources
• https://github.com/akeeba/fof
• Or download F0F from
https://www.akeebabackup.com/download.ht
ml
More Resources
• The documentation (developer guide) for FoF
is found here:
https://www.akeebabackup.com/documentation/fof
• There is also a Google Group:
https://groups.google.com/forum/#!forum/framewo
rkonframework
Questions?
Tim Plummer
www.timplummer.com.au
@bfsurvey

Weitere ähnliche Inhalte

Was ist angesagt?

Behaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalBehaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & Drupalsparkfabrik
 
Problemen oplossen in Joomla - Joomladagen 2014
Problemen oplossen in Joomla - Joomladagen 2014Problemen oplossen in Joomla - Joomladagen 2014
Problemen oplossen in Joomla - Joomladagen 2014Peter Martin
 
CakePHP 2.0 - It'll rock your world
CakePHP 2.0 - It'll rock your worldCakePHP 2.0 - It'll rock your world
CakePHP 2.0 - It'll rock your worldGraham Weldon
 
WordPress Structure and Best Practices
WordPress Structure and Best PracticesWordPress Structure and Best Practices
WordPress Structure and Best Practicesmarkparolisi
 
PloneNG: What's new in Plone 4.2, 4.3, and beyond
PloneNG: What's new in Plone 4.2, 4.3, and beyondPloneNG: What's new in Plone 4.2, 4.3, and beyond
PloneNG: What's new in Plone 4.2, 4.3, and beyondDavid Glick
 
Plone 5 theming unleashed
Plone 5 theming unleashedPlone 5 theming unleashed
Plone 5 theming unleashedsneridagh
 
Joomla! Pizza Bugs and Fun 2014 pre-event Seminar
Joomla! Pizza Bugs and Fun 2014 pre-event SeminarJoomla! Pizza Bugs and Fun 2014 pre-event Seminar
Joomla! Pizza Bugs and Fun 2014 pre-event SeminarGunjan Patel
 
Custom Template for Joomla! 3
Custom Template for Joomla! 3Custom Template for Joomla! 3
Custom Template for Joomla! 3Carly Willats
 
Joomla 3 JLayout's - Joomladay Netherlands 2014 #jd14nl
Joomla 3 JLayout's - Joomladay Netherlands 2014 #jd14nlJoomla 3 JLayout's - Joomladay Netherlands 2014 #jd14nl
Joomla 3 JLayout's - Joomladay Netherlands 2014 #jd14nlPhilip Locke
 
8 Most Common Joomla! Hacks and How to Avoid Them
8 Most Common Joomla! Hacks and How to Avoid Them8 Most Common Joomla! Hacks and How to Avoid Them
8 Most Common Joomla! Hacks and How to Avoid ThemDaniel Kanchev
 
Creating WordPress Theme Faster, Smarter & Without Swearing
Creating WordPress Theme Faster, Smarter & Without SwearingCreating WordPress Theme Faster, Smarter & Without Swearing
Creating WordPress Theme Faster, Smarter & Without Swearingmartinwolak
 
Creating a multilingual site in Joomla 3 (Joomla 3 Beginner's Guide)
Creating a multilingual site in Joomla 3 (Joomla 3 Beginner's Guide)Creating a multilingual site in Joomla 3 (Joomla 3 Beginner's Guide)
Creating a multilingual site in Joomla 3 (Joomla 3 Beginner's Guide)Eric Tiggeler
 
Creating a Great XPages User Interface, TLCC Teamstudio Webinar - Feb, 2014
Creating a Great XPages User Interface, TLCC Teamstudio Webinar - Feb, 2014Creating a Great XPages User Interface, TLCC Teamstudio Webinar - Feb, 2014
Creating a Great XPages User Interface, TLCC Teamstudio Webinar - Feb, 2014Howard Greenberg
 
Easy Blogging With Emacs
Easy Blogging With EmacsEasy Blogging With Emacs
Easy Blogging With EmacsDashamir Hoxha
 
Django, What is it, Why is it cool?
Django, What is it, Why is it cool?Django, What is it, Why is it cool?
Django, What is it, Why is it cool?Tom Brander
 
Getting started-with-zend-framework
Getting started-with-zend-frameworkGetting started-with-zend-framework
Getting started-with-zend-frameworkMarcelo da Rocha
 
DrupalCon LA 2015 Review
DrupalCon LA 2015 ReviewDrupalCon LA 2015 Review
DrupalCon LA 2015 ReviewlittleMAS
 
Joomla Explained - As Easy as 1, 2, 3
Joomla Explained - As Easy as 1, 2, 3Joomla Explained - As Easy as 1, 2, 3
Joomla Explained - As Easy as 1, 2, 3Rod Martin
 
ElggCamp Santiago - Dev Edition
ElggCamp Santiago - Dev EditionElggCamp Santiago - Dev Edition
ElggCamp Santiago - Dev EditionBrett Profitt
 

Was ist angesagt? (20)

Behaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalBehaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & Drupal
 
Problemen oplossen in Joomla - Joomladagen 2014
Problemen oplossen in Joomla - Joomladagen 2014Problemen oplossen in Joomla - Joomladagen 2014
Problemen oplossen in Joomla - Joomladagen 2014
 
CakePHP 2.0 - It'll rock your world
CakePHP 2.0 - It'll rock your worldCakePHP 2.0 - It'll rock your world
CakePHP 2.0 - It'll rock your world
 
WordPress Structure and Best Practices
WordPress Structure and Best PracticesWordPress Structure and Best Practices
WordPress Structure and Best Practices
 
Introduction to CakePHP
Introduction to CakePHPIntroduction to CakePHP
Introduction to CakePHP
 
PloneNG: What's new in Plone 4.2, 4.3, and beyond
PloneNG: What's new in Plone 4.2, 4.3, and beyondPloneNG: What's new in Plone 4.2, 4.3, and beyond
PloneNG: What's new in Plone 4.2, 4.3, and beyond
 
Plone 5 theming unleashed
Plone 5 theming unleashedPlone 5 theming unleashed
Plone 5 theming unleashed
 
Joomla! Pizza Bugs and Fun 2014 pre-event Seminar
Joomla! Pizza Bugs and Fun 2014 pre-event SeminarJoomla! Pizza Bugs and Fun 2014 pre-event Seminar
Joomla! Pizza Bugs and Fun 2014 pre-event Seminar
 
Custom Template for Joomla! 3
Custom Template for Joomla! 3Custom Template for Joomla! 3
Custom Template for Joomla! 3
 
Joomla 3 JLayout's - Joomladay Netherlands 2014 #jd14nl
Joomla 3 JLayout's - Joomladay Netherlands 2014 #jd14nlJoomla 3 JLayout's - Joomladay Netherlands 2014 #jd14nl
Joomla 3 JLayout's - Joomladay Netherlands 2014 #jd14nl
 
8 Most Common Joomla! Hacks and How to Avoid Them
8 Most Common Joomla! Hacks and How to Avoid Them8 Most Common Joomla! Hacks and How to Avoid Them
8 Most Common Joomla! Hacks and How to Avoid Them
 
Creating WordPress Theme Faster, Smarter & Without Swearing
Creating WordPress Theme Faster, Smarter & Without SwearingCreating WordPress Theme Faster, Smarter & Without Swearing
Creating WordPress Theme Faster, Smarter & Without Swearing
 
Creating a multilingual site in Joomla 3 (Joomla 3 Beginner's Guide)
Creating a multilingual site in Joomla 3 (Joomla 3 Beginner's Guide)Creating a multilingual site in Joomla 3 (Joomla 3 Beginner's Guide)
Creating a multilingual site in Joomla 3 (Joomla 3 Beginner's Guide)
 
Creating a Great XPages User Interface, TLCC Teamstudio Webinar - Feb, 2014
Creating a Great XPages User Interface, TLCC Teamstudio Webinar - Feb, 2014Creating a Great XPages User Interface, TLCC Teamstudio Webinar - Feb, 2014
Creating a Great XPages User Interface, TLCC Teamstudio Webinar - Feb, 2014
 
Easy Blogging With Emacs
Easy Blogging With EmacsEasy Blogging With Emacs
Easy Blogging With Emacs
 
Django, What is it, Why is it cool?
Django, What is it, Why is it cool?Django, What is it, Why is it cool?
Django, What is it, Why is it cool?
 
Getting started-with-zend-framework
Getting started-with-zend-frameworkGetting started-with-zend-framework
Getting started-with-zend-framework
 
DrupalCon LA 2015 Review
DrupalCon LA 2015 ReviewDrupalCon LA 2015 Review
DrupalCon LA 2015 Review
 
Joomla Explained - As Easy as 1, 2, 3
Joomla Explained - As Easy as 1, 2, 3Joomla Explained - As Easy as 1, 2, 3
Joomla Explained - As Easy as 1, 2, 3
 
ElggCamp Santiago - Dev Edition
ElggCamp Santiago - Dev EditionElggCamp Santiago - Dev Edition
ElggCamp Santiago - Dev Edition
 

Ähnlich wie Introduction to building joomla! components using FOF

Rapid application development using Akeeba FOF and Joomla 3.2
Rapid application development using Akeeba FOF and Joomla 3.2Rapid application development using Akeeba FOF and Joomla 3.2
Rapid application development using Akeeba FOF and Joomla 3.2JoomlaDay Australia
 
FOF Rapid Application Development on Joomla! - Joomla! Day Denmark 2012
FOF Rapid Application Development on Joomla! - Joomla! Day Denmark 2012FOF Rapid Application Development on Joomla! - Joomla! Day Denmark 2012
FOF Rapid Application Development on Joomla! - Joomla! Day Denmark 2012Nicholas Dionysopoulos
 
Symfony2 Introduction Presentation
Symfony2 Introduction PresentationSymfony2 Introduction Presentation
Symfony2 Introduction PresentationNerd Tzanetopoulos
 
Advance Component Development by Azrul Rahim
Advance Component Development by Azrul RahimAdvance Component Development by Azrul Rahim
Advance Component Development by Azrul RahimJohn Coonen
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfonyFrancois Zaninotto
 
What is the Joomla Framework and why do we need it?
What is the Joomla Framework and why do we need it?What is the Joomla Framework and why do we need it?
What is the Joomla Framework and why do we need it?Rouven Weßling
 
Joomlapresentation
JoomlapresentationJoomlapresentation
Joomlapresentationguestf44ffc
 
JoomlaEXPO Presentation by Joe LeBlanc
JoomlaEXPO Presentation by Joe LeBlancJoomlaEXPO Presentation by Joe LeBlanc
JoomlaEXPO Presentation by Joe LeBlancJohn Coonen
 
Joomlapresentation
JoomlapresentationJoomlapresentation
Joomlapresentationjlleblanc
 
The why and how of moving to php 5.4
The why and how of moving to php 5.4The why and how of moving to php 5.4
The why and how of moving to php 5.4Wim Godden
 
Mageguru - magento custom module development
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development Mage Guru
 
Drupal 8 - Core and API Changes
Drupal 8 - Core and API ChangesDrupal 8 - Core and API Changes
Drupal 8 - Core and API ChangesShabir Ahmad
 
crtical points for customizing Joomla templates
crtical points for customizing Joomla templatescrtical points for customizing Joomla templates
crtical points for customizing Joomla templatesamit das
 
Simple module Development in Joomla! 2.5
Simple module Development in Joomla! 2.5Simple module Development in Joomla! 2.5
Simple module Development in Joomla! 2.5Vishwash Gaur
 
Joomla 3 Component programmeren met RAD - Joomladagen 2014
Joomla 3 Component programmeren met RAD - Joomladagen 2014Joomla 3 Component programmeren met RAD - Joomladagen 2014
Joomla 3 Component programmeren met RAD - Joomladagen 2014Peter Martin
 

Ähnlich wie Introduction to building joomla! components using FOF (20)

Rapid application development using Akeeba FOF and Joomla 3.2
Rapid application development using Akeeba FOF and Joomla 3.2Rapid application development using Akeeba FOF and Joomla 3.2
Rapid application development using Akeeba FOF and Joomla 3.2
 
FOF Rapid Application Development on Joomla! - Joomla! Day Denmark 2012
FOF Rapid Application Development on Joomla! - Joomla! Day Denmark 2012FOF Rapid Application Development on Joomla! - Joomla! Day Denmark 2012
FOF Rapid Application Development on Joomla! - Joomla! Day Denmark 2012
 
Symfony2 Introduction Presentation
Symfony2 Introduction PresentationSymfony2 Introduction Presentation
Symfony2 Introduction Presentation
 
Advance Component Development by Azrul Rahim
Advance Component Development by Azrul RahimAdvance Component Development by Azrul Rahim
Advance Component Development by Azrul Rahim
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfony
 
What is the Joomla Framework and why do we need it?
What is the Joomla Framework and why do we need it?What is the Joomla Framework and why do we need it?
What is the Joomla Framework and why do we need it?
 
Creating a basic joomla
Creating a basic joomlaCreating a basic joomla
Creating a basic joomla
 
Symfony2 meets propel 1.5
Symfony2 meets propel 1.5Symfony2 meets propel 1.5
Symfony2 meets propel 1.5
 
Joomlapresentation
JoomlapresentationJoomlapresentation
Joomlapresentation
 
JoomlaEXPO Presentation by Joe LeBlanc
JoomlaEXPO Presentation by Joe LeBlancJoomlaEXPO Presentation by Joe LeBlanc
JoomlaEXPO Presentation by Joe LeBlanc
 
Joomlapresentation
JoomlapresentationJoomlapresentation
Joomlapresentation
 
The why and how of moving to php 5.4
The why and how of moving to php 5.4The why and how of moving to php 5.4
The why and how of moving to php 5.4
 
Mageguru - magento custom module development
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development
 
Drupal 8 - Core and API Changes
Drupal 8 - Core and API ChangesDrupal 8 - Core and API Changes
Drupal 8 - Core and API Changes
 
Flyr PHP micro-framework
Flyr PHP micro-frameworkFlyr PHP micro-framework
Flyr PHP micro-framework
 
crtical points for customizing Joomla templates
crtical points for customizing Joomla templatescrtical points for customizing Joomla templates
crtical points for customizing Joomla templates
 
Simple module Development in Joomla! 2.5
Simple module Development in Joomla! 2.5Simple module Development in Joomla! 2.5
Simple module Development in Joomla! 2.5
 
Joomla 3 Component programmeren met RAD - Joomladagen 2014
Joomla 3 Component programmeren met RAD - Joomladagen 2014Joomla 3 Component programmeren met RAD - Joomladagen 2014
Joomla 3 Component programmeren met RAD - Joomladagen 2014
 
Php mysql
Php mysqlPhp mysql
Php mysql
 
Joomla Templates101
Joomla Templates101Joomla Templates101
Joomla Templates101
 

Mehr von Tim Plummer

Aujug 2020 joomla 4 workflow
Aujug 2020 joomla 4 workflowAujug 2020 joomla 4 workflow
Aujug 2020 joomla 4 workflowTim Plummer
 
TinyMCE for Joomla
TinyMCE for JoomlaTinyMCE for Joomla
TinyMCE for JoomlaTim Plummer
 
Joomla 4 custom fields and workflow
Joomla 4 custom fields and workflowJoomla 4 custom fields and workflow
Joomla 4 custom fields and workflowTim Plummer
 
How to fix a hacked site and harden June 2019
How to fix a hacked site and harden June 2019How to fix a hacked site and harden June 2019
How to fix a hacked site and harden June 2019Tim Plummer
 
Creating your own joomla templates April 2019
Creating your own joomla templates April 2019Creating your own joomla templates April 2019
Creating your own joomla templates April 2019Tim Plummer
 
Custom fields in Joomla March 2019
Custom fields in Joomla March 2019Custom fields in Joomla March 2019
Custom fields in Joomla March 2019Tim Plummer
 
Whats new in Joomla 3.9
Whats new in Joomla 3.9Whats new in Joomla 3.9
Whats new in Joomla 3.9Tim Plummer
 
Lessons from the other side
Lessons from the other sideLessons from the other side
Lessons from the other sideTim Plummer
 
Getting the most from your social media posts on facebook and instagram
Getting the most from your social media posts on facebook and instagramGetting the most from your social media posts on facebook and instagram
Getting the most from your social media posts on facebook and instagramTim Plummer
 
Tips for site builders and administrators
Tips for site builders and administratorsTips for site builders and administrators
Tips for site builders and administratorsTim Plummer
 
Joomla 4.0 what's coming in future
Joomla 4.0   what's coming in futureJoomla 4.0   what's coming in future
Joomla 4.0 what's coming in futureTim Plummer
 
What’s new in joomla 3.7
What’s new in joomla 3.7What’s new in joomla 3.7
What’s new in joomla 3.7Tim Plummer
 
Simplify your Joomla user registration form
Simplify your Joomla user registration formSimplify your Joomla user registration form
Simplify your Joomla user registration formTim Plummer
 
How to customise Joomla
How to customise JoomlaHow to customise Joomla
How to customise JoomlaTim Plummer
 
Maintaining a joomla website - Canberra
Maintaining a joomla website - CanberraMaintaining a joomla website - Canberra
Maintaining a joomla website - CanberraTim Plummer
 
Custom fields in joomla
Custom fields in joomlaCustom fields in joomla
Custom fields in joomlaTim Plummer
 
Whats new in joomla 3.5 & whats coming in future
Whats new in joomla 3.5 & whats coming in futureWhats new in joomla 3.5 & whats coming in future
Whats new in joomla 3.5 & whats coming in futureTim Plummer
 
Joomla SEO basics 2016
Joomla SEO basics 2016Joomla SEO basics 2016
Joomla SEO basics 2016Tim Plummer
 
What's new in joomla! 3.5 - 8th Nov 2015
What's new in joomla! 3.5 - 8th Nov 2015What's new in joomla! 3.5 - 8th Nov 2015
What's new in joomla! 3.5 - 8th Nov 2015Tim Plummer
 
Cross CMS plugin development using AWF
Cross CMS plugin development using AWFCross CMS plugin development using AWF
Cross CMS plugin development using AWFTim Plummer
 

Mehr von Tim Plummer (20)

Aujug 2020 joomla 4 workflow
Aujug 2020 joomla 4 workflowAujug 2020 joomla 4 workflow
Aujug 2020 joomla 4 workflow
 
TinyMCE for Joomla
TinyMCE for JoomlaTinyMCE for Joomla
TinyMCE for Joomla
 
Joomla 4 custom fields and workflow
Joomla 4 custom fields and workflowJoomla 4 custom fields and workflow
Joomla 4 custom fields and workflow
 
How to fix a hacked site and harden June 2019
How to fix a hacked site and harden June 2019How to fix a hacked site and harden June 2019
How to fix a hacked site and harden June 2019
 
Creating your own joomla templates April 2019
Creating your own joomla templates April 2019Creating your own joomla templates April 2019
Creating your own joomla templates April 2019
 
Custom fields in Joomla March 2019
Custom fields in Joomla March 2019Custom fields in Joomla March 2019
Custom fields in Joomla March 2019
 
Whats new in Joomla 3.9
Whats new in Joomla 3.9Whats new in Joomla 3.9
Whats new in Joomla 3.9
 
Lessons from the other side
Lessons from the other sideLessons from the other side
Lessons from the other side
 
Getting the most from your social media posts on facebook and instagram
Getting the most from your social media posts on facebook and instagramGetting the most from your social media posts on facebook and instagram
Getting the most from your social media posts on facebook and instagram
 
Tips for site builders and administrators
Tips for site builders and administratorsTips for site builders and administrators
Tips for site builders and administrators
 
Joomla 4.0 what's coming in future
Joomla 4.0   what's coming in futureJoomla 4.0   what's coming in future
Joomla 4.0 what's coming in future
 
What’s new in joomla 3.7
What’s new in joomla 3.7What’s new in joomla 3.7
What’s new in joomla 3.7
 
Simplify your Joomla user registration form
Simplify your Joomla user registration formSimplify your Joomla user registration form
Simplify your Joomla user registration form
 
How to customise Joomla
How to customise JoomlaHow to customise Joomla
How to customise Joomla
 
Maintaining a joomla website - Canberra
Maintaining a joomla website - CanberraMaintaining a joomla website - Canberra
Maintaining a joomla website - Canberra
 
Custom fields in joomla
Custom fields in joomlaCustom fields in joomla
Custom fields in joomla
 
Whats new in joomla 3.5 & whats coming in future
Whats new in joomla 3.5 & whats coming in futureWhats new in joomla 3.5 & whats coming in future
Whats new in joomla 3.5 & whats coming in future
 
Joomla SEO basics 2016
Joomla SEO basics 2016Joomla SEO basics 2016
Joomla SEO basics 2016
 
What's new in joomla! 3.5 - 8th Nov 2015
What's new in joomla! 3.5 - 8th Nov 2015What's new in joomla! 3.5 - 8th Nov 2015
What's new in joomla! 3.5 - 8th Nov 2015
 
Cross CMS plugin development using AWF
Cross CMS plugin development using AWFCross CMS plugin development using AWF
Cross CMS plugin development using AWF
 

Kürzlich hochgeladen

Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 

Kürzlich hochgeladen (20)

Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 

Introduction to building joomla! components using FOF

  • 1. Introduction to building Joomla! components using FOF Presented at J and Beyond 2014 Tim Plummer
  • 2.
  • 3.
  • 4.
  • 5.
  • 6. FOF = Framework on Framework
  • 7. What is FOF? • Rapid application development framework for Joomla • Not standalone – it extends Joomla • Aim to not break backwards compatibility without a clear deprecation and migration path.
  • 8. Who made FOF? • Created by Nicholas Dionysopoulos • Now over 31 contributors
  • 9. Why FOF? • Learn how to create components quickly and easily with very little code • Since Joomla 3.2, FOF has been included in the core
  • 10. You can read about why this happened at: https://groups.google.com/forum/#!topic/frameworkonframework/VxxIKvTooXU How FOF became F0F (F zero F)
  • 11. FOF vs F0F • All class prefixes changed from FOF to F0F (the letter O was changed to number 0) to avoid naming conflicts with Joomla!'s outdated copy of FOF
  • 12. FOF vs F0F • Joomla v3.3.0 includes FOF v2.2.1. This is the last version included in Joomla v3 series until a future Joomla v4 • New F0F v2.3.0, all extensions must have an installer with the new library
  • 13. What’s happening with FOF? • The version shipped with Joomla is no longer maintained • It will not be removed until Joomla 4.0. We are not going to break existing extensions. • Recommended to use F0F instead (you must include logic to install it with your extension) https://groups.google.com/forum/#!topic/joomla-dev-cms/_HaeK8-33dk
  • 14. Future of F0F? • F0F isn’t dying, it’s actively maintained. • The bigger goal for [Nicholas] is having F0F as a RAD framework for Joomla! and AWF as the more powerful framework that goes beyond just Joomla! • AWF is a framework designed to create single- source applications that can run standalone, as a native Joomla! component and as a native WordPress plugin (conceivably also as a native Drupal module)
  • 15. Key Dates • May 2012 – First public release • June 2012 – Bootstrap & jQuery • March 2013 – XML view templates • September 2013 – Added to Joomla 3.2 core • May 2014 - F0F fork
  • 16. Benefits • Less code = less bugs • Less code = quicker to develop • Automagic stuff to make your life easier
  • 17. F0F System Requirements • Joomla 2.5.6 or greater • PHP 5.3.3
  • 18. Convention over configuration • Use the FOF naming conventions and you get functionality for free
  • 19. Key Features • Reuse views while respecting template overrides – loadAnyTemplate() allows you to load any view • Media files overrides – effectively create template overrides for css and js files • Automatic JSON and CSV in views – Just add format=json or format=csv • XML-based views – You can mix PHP-based and XML-based templates
  • 20. Magic Fields • Just add to your database table and all these just magically work and implement required functionality – enabled (like state or published) – created_by – created_on (like created) – modified_by – modified_on (like modified) – locked_by (like checked_out) – locked_on (like checked_out_time) – hits
  • 21. NOW LET’S LOOK AT AN EXAMPLE
  • 22. What are we going to make? • Simple timesheet application com_timesheet will be used to demonstrate some F0F features
  • 23. Source code You can access all source code shown today via https://github.com/tuum/com_timesheet
  • 24. Database CREATE TABLE IF NOT EXISTS `#__timesheet_items` ( `timesheet_item_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(255) NOT NULL, `slug` varchar(50) NOT NULL, PRIMARY KEY (`timesheet_item_id`) ) DEFAULT CHARSET=utf8; /administrator/components/com_timesheet/sql/install/mysql/install.sql component name view name (plural) view name (singular) id field as per above *Note, final table has more fields, this is just demonstrating naming standards
  • 25. Entry Point <?php defined('_JEXEC') or die(); // Load FOF include_once JPATH_LIBRARIES.'/f0f/include.php'; if(!defined('F0F_INCLUDED')) { JError::raiseError ('500', 'FOF is not installed'); return; } F0FDispatcher::getTmpInstance('com_timesheet')->dispatch(); /administrator/components/com_timesheet/timesheet.php component name
  • 26. Dispatcher <?xml version="1.0" encoding="UTF-8"?> <fof> <!-- Component back-end options --> <backend> <!-- Dispatcher options --> <dispatcher> <option name="default_view">cpanels</option> </dispatcher> </backend> </fof> /administrator/components/com_timesheet/fof.xml default view
  • 27. Dispatcher • Also using PHP dispatcher to load Akeeba Strapper • Could use this to define default view if you wanted /administrator/components/com_timesheet/dispatcher.php
  • 28. Installation XML • Aka XML Manifest • Just like a normal Joomla component /administrator/components/com_timesheet/com_timesheet.xml
  • 29. Config • Just like a normal Joomla component /administrator/components/com_timesheet/config.xml
  • 30. Access • Just like a normal Joomla component /administrator/components/com_timesheet/access.xml
  • 31. View files • browse – list page default.php or form.default.xml • edit – edit page form.php or form.form.xml • read – show single record without being able to edit item.php or form.item.xml
  • 33. List view • Each column has a header <header name="title" type="fieldsearchable" sortable="true" buttons="no" buttonclass="btn" /> <field name="title" type="text" show_link="true" url="index.php?option=com_timesheet&amp;view=category&amp;id=[ITEM:ID]" /> and a field
  • 34. List view • Want to make a column sortable? Just add sortable="true“ to header
  • 35. Form
  • 36. Form <?xml version="1.0" encoding="utf-8"?> <form validate="true"> <fieldset name="basic_configuration" label="COM_TIMESHEET_CATEGORIES_GROUP_BASIC" > <field name="title" type="text" label="COM_TIMESHEET_CATEGORIES_FIELD_CATEGORY_TITLE_LABEL" description="COM_TIMESHEET_CATEGORIES_FIELD_CATEGORY_TITLE_DESC" class="input-xlarge hasTooltip" required="true" /> </fieldset> </form> *Note, final XML file has more fields
  • 37. Cpanel view icons <div class=icon> <a href="index.php?option=com_timesheet&view=categories"> <div class="timesheet-icon-category"> </div> <span><?php echo JText::_('COM_TIMESHEET_TITLE_CATEGORIES'); ?></span> </a> </div> /administrator/components/com_timesheet/views/cpanels/tmpl/default.php
  • 38. Cpanel view icons .timesheet-icon-item { background: url("../../../media/com_timesheet/images/timesheet_icon.png") no- repeat scroll left top transparent; display: block; height: 32px; margin: 4px auto 6px; overflow: hidden; text-indent: -99999px; width: 32px; } /media/com_timesheet/css/backend.css
  • 39. Version specific view • For example, you may wish to move location of ordering column in Joomla 2.5 vs Joomla 3
  • 40. Version specific view • FOF will automatically search for view template files (or XML forms) suffixed with the Joomla! version family or version number • Joomla! 2.5 – default.j25.php, default.j2.php and default.php • Joomla! 3.2 – default.j32.php, default.j3.php and default.php • Also applies to XML forms – form.default.j25.xml, form.default.j2.xml
  • 41. Mix and match PHP with XML For example, you may wish to style the select
  • 42. Mix and match PHP with XML <?php defined('_JEXEC') or die(); if (version_compare(JVERSION, '3.0.0', 'gt')) { JHtml::_('formbehavior.chosen', 'select'); } $viewTemplate = $this->getRenderedForm(); echo $viewTemplate; This bit loads the XML file
  • 43. Add toolbar buttons public function onCategoriesBrowse() { $this->onBrowse(); JToolBarHelper::divider(); JToolbarHelper::back('JTOOLBAR_BACK','index.php?option=co m_timesheet&view=cpanels'); } /administrator/components/com_timesheet/toolbar.php
  • 44. CSV format • Append &format=csv to any view index.php?option=com_timesheet&view=categories&format=csv
  • 45. JSON format • Append &format=json to any view index.php?option=com_timesheet&view=categories&format=json
  • 46. Front end <?php defined('_JEXEC') or die(); echo $this->loadAnyTemplate('admin:com_timesheet/item/form'); Note loadAnyTemplate() is better than include() or require() as it respects template overrides Could be site to load front end view Can load one of the backend views using loadAnyTemplate
  • 47. Front end <?php defined('_JEXEC') or die(); echo $this->getRenderedForm(); F0F is smart enough to figure out that if you don’t have XML file in front end, look for view with same name in backend
  • 48. Front end toolbar public function onItemsAdd() { //show toolbar on front end $this->renderFrontendButtons = true; parent::onAdd(); } /administrator/components/com_timesheet/toolbar.php
  • 49. Automatic language loading • FOF automatically loads component language files (frontend and backend) • English loads first, then site/user language loads next and overrides English
  • 50. Media file overrides • /templates/yourtemplate/media/ (not the HTML folder) • Can effectively create template overrides for CSS and Javascript files.
  • 51. Installation script • F0FUtilsInstallscript makes it much easier to install F0F and Akeeba Strapper /administrator/components/com_timesheet/file.script.php
  • 56. Media
  • 58. Now you are ready to start creating your own components with FOF
  • 59. Resources • https://github.com/akeeba/fof • Or download F0F from https://www.akeebabackup.com/download.ht ml
  • 60. More Resources • The documentation (developer guide) for FoF is found here: https://www.akeebabackup.com/documentation/fof • There is also a Google Group: https://groups.google.com/forum/#!forum/framewo rkonframework