SlideShare a Scribd company logo
1 of 34
Develop Basic Joomla! MVC Component for
version 3.x
Gunjan Patel
Sr. PHP Developer
Joomla! Bug Squad Member
Joomla! SQL Optimisation team coordinator
Google Summer Of Code 2014 Mentor
Joomla! User Network Ahmedabad
My Joomla! Family
gunjan.ce2009@gmail.com @ergunjanpatel
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Important Tools
• WebServer, PHP, MySQL - XAMP or WAMP server
• Text Editor or IDE - PhpStorm or SublimeText3
• Web Browser - Firebug and WebDeveloper addons
• Joomla! Coding Standard
• Php Code Sniffer - PHPCS
• jQuery
• BootStrap
• Xdebug
All above are good to know and it
will be a plus point.
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Required Skills
Must Know Good to know
• PHP – Minimum 5.3.10 +
• Object Oriented Concepts
• MVC Structure
• HTML
• CSS – Basic
• JavaScript – Entry Level
Joomla! License
• The Joomla software and
default templates are
copyright 2005-2013 Open
Source Matters, Inc.
• You can use, copy, modify
or distribute Joomla!
Under GNU General Public
License.
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Security
• Never Trust your User
• Always, sanitize user input
• Use native joomla!
functions to get user
inputs.
Go to Global Configuration
• Set error reporting to
“Development”
• Enable System Debug Mode
• Disable Search Engine Friendly
URLs
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Error Reporting Only do this on
development sites
What is Joomla! Component?
• Components are the main functional units of Joomla!
• Let’s say for example: Joomla! is the operating
system and the components are desktop
applications.
• They are usually displayed in the center of the main
content area of a template (depending on the
template).
• Most components have two part:
• Administrator
• Provide configuration of component
• And Backend Activity
• Site
• Used to render pages when being called during normal
site operation.
• com_content and com_contact as an examples.
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
What is Joomla! Module?
• We can say that modules are “boxes” arranged
around component.
• Usually light weight, flexible
• Modules can be assigned to menu items. So, it
can be our choice on which page we want to
show it.
• Some modules are linked to components: the
“latest news” module, for example, links to the
content component (com_content) and displays
links to the newest content items.
• However, modules do not need to be linked to
components;
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
What is Joomla! Plugin?
• It provide functions which are associated with
trigger events.
• Joomla provides a set of core plugin events, but
any extension can fire (custom) events.
• When a particular event occurs, all plugin
functions of the type associated with the event
are executed in sequence.
• This is a powerful way of extending the
functionality of the Joomla! Platform.
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Joomla! Installation
• Search in Google “developing MVC component in joomla
3” go with the first link.
• In http://docs.joomla.org it is explained really good.
• I will use the same document and will explain you in deep.
• Joomla! Component starts with “com_” prefix in name.
• In URL you can access it using,
http://gunjanpat.el/workshop/administrator/index.php?option=com_helloworld
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Let’s start with com_helloworld
Folder Structure
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Administrator files
Media files
Frontend Files
Important Files
• admin/helloworld.php
• admin/controller.php
• admin/views/view.html.php
• admin/views/tmpl/default.php
• admin/models/helloworld.php
• admin/controllers/helloworld.php
• site/helloworld.php
• site/controller.php
• site/views/view.html.php
• site/views/tmpl/default.php
• site/models/helloworld.php
Media files are optional, ideally
depends on requirement
Folder Structure after installation
Joomla! User Network Ahmedabad Gunjan Patel 14
Changed to administrator/components/com_helloworld/* From admin/*
Changed to components/com_helloworld/* From site/*`
Changed to media/com_helloworld/* From media/*
Let’s create files step by step… helloworld.xml
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
File Type: XML Declare Joomla! Extension type
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Adding site and admin files
Create site/helloworld.php file and add
Create admin/helloworld.php file and add
Create index.html common to all folders
ZIP it
Adding a view to the site part
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Entry point of controller : site/helloworld.php
Stop direct access of file
Static Function
Execute Controller task
Class
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Setting the controller: site/controller.php
Component name as a prefix
Extending from parent class
Setting the view
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
1. Create folder at <yoursite-url>/components/com_[component_name]/views/[name of view]/
2. For helloworld it will look like, yoursite/components/com_helloworld/views/helloworld/
3. Create file at view.[view_mode].php
• view_mode = HTML, XML, CSV, PDF etc…
4. Create folder named tmpl and add default.php file. So, path will be look like,
yoursite/components/com_helloworld/views/helloworld/tmpl/default.php
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
components/com_helloworld/views/helloworld/view.html.php
default.php
1 2
1. Component Name
2. View Name
Access using Url:
index.php?option=com_helloworld
&view=helloworld
View Name
Update in helloworld.xml
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Add new lines
ZIP it
Adding a menu type to the site part
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
site/views/helloworld/tmpl/default.xml
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
site/views/helloworld/tmpl/default.xml
Adding a model to the site part
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Create file site/models/helloworld.php
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Model name – same as your view name
Set Display message from model now.
Update site/views/helloworld/view.html.php accordingly…
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Get data from Model function now.
Update in helloworld.xml
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
ZIP it
Add models folder
Adding a variable request in the menu type
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Let’s improve XML - site/views/helloworld/tmpl/default.xml
HTML Select List
Let’s improve model - site/models/helloworld.php
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Current function
No need to update helloworld.xml
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
JUST ZIP it
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Any Questions so far?

More Related Content

What's hot

Angular - Chapter 1 - Introduction
 Angular - Chapter 1 - Introduction Angular - Chapter 1 - Introduction
Angular - Chapter 1 - IntroductionWebStackAcademy
 
Angular 5 presentation for beginners
Angular 5 presentation for beginnersAngular 5 presentation for beginners
Angular 5 presentation for beginnersImran Qasim
 
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...Simplilearn
 
Introduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectIntroduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectJadson Santos
 
Routing & Navigating Pages in Angular 2
Routing & Navigating Pages in Angular 2Routing & Navigating Pages in Angular 2
Routing & Navigating Pages in Angular 2Knoldus Inc.
 
안드로이드 윈도우 마스터 되기
안드로이드 윈도우 마스터 되기안드로이드 윈도우 마스터 되기
안드로이드 윈도우 마스터 되기Myungwook Ahn
 
HTML5: features with examples
HTML5: features with examplesHTML5: features with examples
HTML5: features with examplesAlfredo Torre
 
React hooks Episode #1: An introduction.
React hooks Episode #1: An introduction.React hooks Episode #1: An introduction.
React hooks Episode #1: An introduction.ManojSatishKumar
 
Angular App Presentation
Angular App PresentationAngular App Presentation
Angular App PresentationElizabeth Long
 
Angular Advanced Routing
Angular Advanced RoutingAngular Advanced Routing
Angular Advanced RoutingLaurent Duveau
 
Introduction to Version Control
Introduction to Version ControlIntroduction to Version Control
Introduction to Version ControlJeremy Coates
 
React Context API
React Context APIReact Context API
React Context APINodeXperts
 

What's hot (20)

Git & GitHub for Beginners
Git & GitHub for BeginnersGit & GitHub for Beginners
Git & GitHub for Beginners
 
Angular 9
Angular 9 Angular 9
Angular 9
 
Angular - Chapter 1 - Introduction
 Angular - Chapter 1 - Introduction Angular - Chapter 1 - Introduction
Angular - Chapter 1 - Introduction
 
Angular Data Binding
Angular Data BindingAngular Data Binding
Angular Data Binding
 
Angular 5 presentation for beginners
Angular 5 presentation for beginnersAngular 5 presentation for beginners
Angular 5 presentation for beginners
 
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
 
What’s New in Angular 14?
What’s New in Angular 14?What’s New in Angular 14?
What’s New in Angular 14?
 
Introduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectIntroduction to angular with a simple but complete project
Introduction to angular with a simple but complete project
 
Routing & Navigating Pages in Angular 2
Routing & Navigating Pages in Angular 2Routing & Navigating Pages in Angular 2
Routing & Navigating Pages in Angular 2
 
안드로이드 윈도우 마스터 되기
안드로이드 윈도우 마스터 되기안드로이드 윈도우 마스터 되기
안드로이드 윈도우 마스터 되기
 
HTML5: features with examples
HTML5: features with examplesHTML5: features with examples
HTML5: features with examples
 
React hooks Episode #1: An introduction.
React hooks Episode #1: An introduction.React hooks Episode #1: An introduction.
React hooks Episode #1: An introduction.
 
Modern JS with ES6
Modern JS with ES6Modern JS with ES6
Modern JS with ES6
 
Angular App Presentation
Angular App PresentationAngular App Presentation
Angular App Presentation
 
Angular Advanced Routing
Angular Advanced RoutingAngular Advanced Routing
Angular Advanced Routing
 
Introduction to Version Control
Introduction to Version ControlIntroduction to Version Control
Introduction to Version Control
 
VueJS: The Simple Revolution
VueJS: The Simple RevolutionVueJS: The Simple Revolution
VueJS: The Simple Revolution
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
 
React Context API
React Context APIReact Context API
React Context API
 
Angular
AngularAngular
Angular
 

Similar to Develop Basic joomla! MVC component for version 3

Techgig Webinar: Joomla Introduction and Module Development June 2012
Techgig Webinar: Joomla Introduction and Module Development June 2012Techgig Webinar: Joomla Introduction and Module Development June 2012
Techgig Webinar: Joomla Introduction and Module Development June 2012Vishwash Gaur
 
Joomla Tutorial: Joomla 2.5 a first look
Joomla Tutorial: Joomla 2.5 a first lookJoomla Tutorial: Joomla 2.5 a first look
Joomla Tutorial: Joomla 2.5 a first lookTim Plummer
 
Joomla2 5-afirstlook-120214054019-phpapp01
Joomla2 5-afirstlook-120214054019-phpapp01Joomla2 5-afirstlook-120214054019-phpapp01
Joomla2 5-afirstlook-120214054019-phpapp01Deepak Sangramsingh
 
Joomla @ Barcamp4(Feb 08 Pune)
Joomla @ Barcamp4(Feb 08 Pune)Joomla @ Barcamp4(Feb 08 Pune)
Joomla @ Barcamp4(Feb 08 Pune)Amit Kumar Singh
 
Integrate Shindig with Joomla
Integrate Shindig with JoomlaIntegrate Shindig with Joomla
Integrate Shindig with JoomlaAnand Sharma
 
Mageguru - magento custom module development
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development Mage Guru
 
Modules and Components Introduction in Joomla! 2.5
Modules and Components Introduction in Joomla! 2.5Modules and Components Introduction in Joomla! 2.5
Modules and Components Introduction in Joomla! 2.5Vishwash Gaur
 
Joomla! Templates and Comparison of Frameworks
Joomla! Templates and Comparison of FrameworksJoomla! Templates and Comparison of Frameworks
Joomla! Templates and Comparison of FrameworksSaurabh Shah
 
Basics of Joomla!
Basics of Joomla! Basics of Joomla!
Basics of Joomla! Saurabh Shah
 
How to Build a Website using Joomla
How to Build a Website using JoomlaHow to Build a Website using Joomla
How to Build a Website using JoomlaMamunur Rashid
 
How to Develop Your First Ever Joomla Template?
How to Develop Your First Ever Joomla Template?How to Develop Your First Ever Joomla Template?
How to Develop Your First Ever Joomla Template?damienwoods
 
Joomla Day India 2009 Business Logic With The Mvc
Joomla Day India 2009   Business Logic With The MvcJoomla Day India 2009   Business Logic With The Mvc
Joomla Day India 2009 Business Logic With The MvcAmit Kumar Singh
 
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
 
appengine ja night #25 Google App Engine for PHP (English)
appengine ja night #25 Google App Engine for PHP (English)appengine ja night #25 Google App Engine for PHP (English)
appengine ja night #25 Google App Engine for PHP (English)Ryo Yamasaki
 
php[world] Magento101
php[world] Magento101php[world] Magento101
php[world] Magento101Mathew Beane
 

Similar to Develop Basic joomla! MVC component for version 3 (20)

Techgig Webinar: Joomla Introduction and Module Development June 2012
Techgig Webinar: Joomla Introduction and Module Development June 2012Techgig Webinar: Joomla Introduction and Module Development June 2012
Techgig Webinar: Joomla Introduction and Module Development June 2012
 
Joomla Tutorial: Joomla 2.5 a first look
Joomla Tutorial: Joomla 2.5 a first lookJoomla Tutorial: Joomla 2.5 a first look
Joomla Tutorial: Joomla 2.5 a first look
 
Joomla2 5-afirstlook-120214054019-phpapp01
Joomla2 5-afirstlook-120214054019-phpapp01Joomla2 5-afirstlook-120214054019-phpapp01
Joomla2 5-afirstlook-120214054019-phpapp01
 
Joomla @ Barcamp4(Feb 08 Pune)
Joomla @ Barcamp4(Feb 08 Pune)Joomla @ Barcamp4(Feb 08 Pune)
Joomla @ Barcamp4(Feb 08 Pune)
 
Integrate Shindig with Joomla
Integrate Shindig with JoomlaIntegrate Shindig with Joomla
Integrate Shindig with Joomla
 
Mageguru - magento custom module development
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development
 
Modules and Components Introduction in Joomla! 2.5
Modules and Components Introduction in Joomla! 2.5Modules and Components Introduction in Joomla! 2.5
Modules and Components Introduction in Joomla! 2.5
 
Joomla! Templates and Comparison of Frameworks
Joomla! Templates and Comparison of FrameworksJoomla! Templates and Comparison of Frameworks
Joomla! Templates and Comparison of Frameworks
 
Social website
Social websiteSocial website
Social website
 
Basics of Joomla!
Basics of Joomla! Basics of Joomla!
Basics of Joomla!
 
How to Build a Website using Joomla
How to Build a Website using JoomlaHow to Build a Website using Joomla
How to Build a Website using Joomla
 
How to Develop Your First Ever Joomla Template?
How to Develop Your First Ever Joomla Template?How to Develop Your First Ever Joomla Template?
How to Develop Your First Ever Joomla Template?
 
Joomla Day India 2009 Business Logic With The Mvc
Joomla Day India 2009   Business Logic With The MvcJoomla Day India 2009   Business Logic With The Mvc
Joomla Day India 2009 Business Logic With The Mvc
 
Creating a basic joomla
Creating a basic joomlaCreating a basic joomla
Creating a basic joomla
 
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 - CMS
Joomla - CMSJoomla - CMS
Joomla - CMS
 
Joomla Basics
Joomla BasicsJoomla Basics
Joomla Basics
 
Html5
Html5Html5
Html5
 
appengine ja night #25 Google App Engine for PHP (English)
appengine ja night #25 Google App Engine for PHP (English)appengine ja night #25 Google App Engine for PHP (English)
appengine ja night #25 Google App Engine for PHP (English)
 
php[world] Magento101
php[world] Magento101php[world] Magento101
php[world] Magento101
 

Recently uploaded

Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 

Recently uploaded (20)

Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 

Develop Basic joomla! MVC component for version 3

  • 1. Develop Basic Joomla! MVC Component for version 3.x Gunjan Patel Sr. PHP Developer Joomla! Bug Squad Member Joomla! SQL Optimisation team coordinator Google Summer Of Code 2014 Mentor Joomla! User Network Ahmedabad
  • 3. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Important Tools • WebServer, PHP, MySQL - XAMP or WAMP server • Text Editor or IDE - PhpStorm or SublimeText3 • Web Browser - Firebug and WebDeveloper addons • Joomla! Coding Standard • Php Code Sniffer - PHPCS
  • 4. • jQuery • BootStrap • Xdebug All above are good to know and it will be a plus point. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Required Skills Must Know Good to know • PHP – Minimum 5.3.10 + • Object Oriented Concepts • MVC Structure • HTML • CSS – Basic • JavaScript – Entry Level
  • 5. Joomla! License • The Joomla software and default templates are copyright 2005-2013 Open Source Matters, Inc. • You can use, copy, modify or distribute Joomla! Under GNU General Public License. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
  • 6. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Security • Never Trust your User • Always, sanitize user input • Use native joomla! functions to get user inputs.
  • 7. Go to Global Configuration • Set error reporting to “Development” • Enable System Debug Mode • Disable Search Engine Friendly URLs Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Error Reporting Only do this on development sites
  • 8. What is Joomla! Component? • Components are the main functional units of Joomla! • Let’s say for example: Joomla! is the operating system and the components are desktop applications. • They are usually displayed in the center of the main content area of a template (depending on the template). • Most components have two part: • Administrator • Provide configuration of component • And Backend Activity • Site • Used to render pages when being called during normal site operation. • com_content and com_contact as an examples. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
  • 9. What is Joomla! Module? • We can say that modules are “boxes” arranged around component. • Usually light weight, flexible • Modules can be assigned to menu items. So, it can be our choice on which page we want to show it. • Some modules are linked to components: the “latest news” module, for example, links to the content component (com_content) and displays links to the newest content items. • However, modules do not need to be linked to components; Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
  • 10. What is Joomla! Plugin? • It provide functions which are associated with trigger events. • Joomla provides a set of core plugin events, but any extension can fire (custom) events. • When a particular event occurs, all plugin functions of the type associated with the event are executed in sequence. • This is a powerful way of extending the functionality of the Joomla! Platform. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
  • 11. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Joomla! Installation
  • 12. • Search in Google “developing MVC component in joomla 3” go with the first link. • In http://docs.joomla.org it is explained really good. • I will use the same document and will explain you in deep. • Joomla! Component starts with “com_” prefix in name. • In URL you can access it using, http://gunjanpat.el/workshop/administrator/index.php?option=com_helloworld Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Let’s start with com_helloworld
  • 13. Folder Structure Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Administrator files Media files Frontend Files Important Files • admin/helloworld.php • admin/controller.php • admin/views/view.html.php • admin/views/tmpl/default.php • admin/models/helloworld.php • admin/controllers/helloworld.php • site/helloworld.php • site/controller.php • site/views/view.html.php • site/views/tmpl/default.php • site/models/helloworld.php Media files are optional, ideally depends on requirement
  • 14. Folder Structure after installation Joomla! User Network Ahmedabad Gunjan Patel 14 Changed to administrator/components/com_helloworld/* From admin/* Changed to components/com_helloworld/* From site/*` Changed to media/com_helloworld/* From media/*
  • 15. Let’s create files step by step… helloworld.xml Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel File Type: XML Declare Joomla! Extension type
  • 16. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Adding site and admin files Create site/helloworld.php file and add Create admin/helloworld.php file and add Create index.html common to all folders ZIP it
  • 17. Adding a view to the site part Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
  • 18. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Entry point of controller : site/helloworld.php Stop direct access of file Static Function Execute Controller task Class
  • 19. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Setting the controller: site/controller.php Component name as a prefix Extending from parent class
  • 20. Setting the view Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel 1. Create folder at <yoursite-url>/components/com_[component_name]/views/[name of view]/ 2. For helloworld it will look like, yoursite/components/com_helloworld/views/helloworld/ 3. Create file at view.[view_mode].php • view_mode = HTML, XML, CSV, PDF etc… 4. Create folder named tmpl and add default.php file. So, path will be look like, yoursite/components/com_helloworld/views/helloworld/tmpl/default.php
  • 21. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel components/com_helloworld/views/helloworld/view.html.php default.php 1 2 1. Component Name 2. View Name Access using Url: index.php?option=com_helloworld &view=helloworld View Name
  • 22. Update in helloworld.xml Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Add new lines ZIP it
  • 23. Adding a menu type to the site part Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
  • 24. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel site/views/helloworld/tmpl/default.xml
  • 25. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel site/views/helloworld/tmpl/default.xml
  • 26. Adding a model to the site part Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
  • 27. Create file site/models/helloworld.php Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Model name – same as your view name Set Display message from model now.
  • 28. Update site/views/helloworld/view.html.php accordingly… Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Get data from Model function now.
  • 29. Update in helloworld.xml Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel ZIP it Add models folder
  • 30. Adding a variable request in the menu type Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
  • 31. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Let’s improve XML - site/views/helloworld/tmpl/default.xml HTML Select List
  • 32. Let’s improve model - site/models/helloworld.php Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Current function
  • 33. No need to update helloworld.xml Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel JUST ZIP it
  • 34. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Any Questions so far?