SlideShare a Scribd company logo
1 of 31
Develop Advance 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
Meet my Joomla! Family
gunjan.ce2009@gmail.com
Time to play with the Database
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Create two files:
1. admin/sql/install.mysql.utf8.sql
2. admin/sql/updates/mysql/0.0.6.sql
Important:
#__schemas table will be used
for upgrades
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Adding a new field type: type="helloworld"
Field file path
Field Custom Type:
helloworld
Notice that it was
Before list
Let’s create field at admin/models/fields/helloworld.php
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Parent field type
Same as filename
File Name should be same as
Field type name
Class name prefix
Should be same as filename
Continue with… admin/models/fields/helloworld.php
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Overriding parent class for
HTML select list options.
Get Database Object
Joomla Query Language
functions
Looping to create options array
JHTML options type value text
Display the chosen message from field type in
menu using Database Table
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Create the admin/tables/helloworld.php file
Table Name
Primary Key
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Modify the site/models/helloworld.php file
Return the table instance
Add new getTable function
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Modify the site/models/helloworld.php file
Update getMsg function to get
Message from Database
Get message id from request.
Notice that here we are not using
$_POST or $_GET
Load table data from auto increment id
Update in helloworld.xml
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
ZIP it
Develop Basic Backend
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Create the admin/helloworld.php file
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Create the general controller admin/controller.php file
Set Default view of
component
Component prefix.
Typically name of
component
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Create the view admin/views/helloworlds/view.html.php file
Parent ClassView NameComponent
Name as class prefix
Call Model get Item
function and pagination
function to support
pagination
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Create the layout admin/views/helloworlds/tmpl/default.php file
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Create the sub-layout
admin/views/helloworlds/tmpl/default_head.php file
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Create the sub-layout
admin/views/helloworlds/tmpl/default_body.php file
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Create the sub-layout
admin/views/helloworlds/tmpl/default_foot.php file
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Create the Model admin/models/helloworlds.php file
Parent class for listing
Function of joomla.
getListQuery function
return query object
Review helloworld.xml
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
ZIP it
• Language files naming conventions:
–For components
• en-GB/en-GB.com_helloworld.ini
–For Menus
• en-GB/en-GB.com_helloworld.sys.ini
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Adding Language Translation Files
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Language File Naming Pattern
For Example:
en-GB : Language code for English (UK)
gu-IN : Language code for Gujarati (India)
hn-IN : Language code for Hindi (India)
<language code>-<country code>
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Language File Naming Pattern
For Example:
en-GB : Language code for English (UK)
gu-IN : Language code for Gujarati (India)
hn-IN : Language code for Hindi (India)
<language code>-<country code>
<language code>-<country code>.com_<component_name>.[type].ini
For Example:
en-GB.com_helloworld.ini
gu-IN.com_helloworld.ini
----------------------------------------
en-GB.com_helloworld.sys.ini
Gu-IN.com_helloworld.sys.ini
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Language String Pattern
For Example:
COM_HELLOWORLD="Hello World!"
COM_HELLOWORLD_DESCRIPTION="This is the Hello World description"
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE="Hello World"
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC="This view displays a selected message"
COM_HELLOWORLD_MENU="Hello World!"
<language_key>=“<language_string_value>”
Language File Location Options in
helloworld.xml file
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Language File Naming Pattern
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
or simply in ROOT
Update helloworld.xml
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
ZIP it
Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
Any Questions?

More Related Content

What's hot

AEM Rich Text Editor (RTE) Deep Dive
AEM Rich Text Editor (RTE) Deep DiveAEM Rich Text Editor (RTE) Deep Dive
AEM Rich Text Editor (RTE) Deep DiveHanish Bansal
 
Developing New Widgets for your Views in Owl
Developing New Widgets for your Views in OwlDeveloping New Widgets for your Views in Owl
Developing New Widgets for your Views in OwlOdoo
 
Owl: The New Odoo UI Framework
Owl: The New Odoo UI FrameworkOwl: The New Odoo UI Framework
Owl: The New Odoo UI FrameworkOdoo
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Modelchomas kandar
 
Django for Beginners
Django for BeginnersDjango for Beginners
Django for BeginnersJason Davies
 
Connecting Connect with Spring Boot
Connecting Connect with Spring BootConnecting Connect with Spring Boot
Connecting Connect with Spring BootVincent Kok
 
Why and How to Use Virtual DOM
Why and How to Use Virtual DOMWhy and How to Use Virtual DOM
Why and How to Use Virtual DOMDaiwei Lu
 
Aem dispatcher – tips & tricks
Aem dispatcher – tips & tricksAem dispatcher – tips & tricks
Aem dispatcher – tips & tricksAshokkumar T A
 
What is HTML - An Introduction to HTML (Hypertext Markup Language)
What is HTML - An Introduction to HTML (Hypertext Markup Language)What is HTML - An Introduction to HTML (Hypertext Markup Language)
What is HTML - An Introduction to HTML (Hypertext Markup Language)Ahsan Rahim
 
Integration patterns in AEM 6
Integration patterns in AEM 6Integration patterns in AEM 6
Integration patterns in AEM 6Yuval Ararat
 
Document object model
Document object modelDocument object model
Document object modelAmit kumar
 
Better web apps with React and Redux
Better web apps with React and ReduxBetter web apps with React and Redux
Better web apps with React and ReduxAli Sa'o
 
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepJava Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepGuo Albert
 

What's hot (20)

AEM Rich Text Editor (RTE) Deep Dive
AEM Rich Text Editor (RTE) Deep DiveAEM Rich Text Editor (RTE) Deep Dive
AEM Rich Text Editor (RTE) Deep Dive
 
Developing New Widgets for your Views in Owl
Developing New Widgets for your Views in OwlDeveloping New Widgets for your Views in Owl
Developing New Widgets for your Views in Owl
 
Owl: The New Odoo UI Framework
Owl: The New Odoo UI FrameworkOwl: The New Odoo UI Framework
Owl: The New Odoo UI Framework
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
Django for Beginners
Django for BeginnersDjango for Beginners
Django for Beginners
 
Connecting Connect with Spring Boot
Connecting Connect with Spring BootConnecting Connect with Spring Boot
Connecting Connect with Spring Boot
 
Why and How to Use Virtual DOM
Why and How to Use Virtual DOMWhy and How to Use Virtual DOM
Why and How to Use Virtual DOM
 
slingmodels
slingmodelsslingmodels
slingmodels
 
Aem dispatcher – tips & tricks
Aem dispatcher – tips & tricksAem dispatcher – tips & tricks
Aem dispatcher – tips & tricks
 
What is HTML - An Introduction to HTML (Hypertext Markup Language)
What is HTML - An Introduction to HTML (Hypertext Markup Language)What is HTML - An Introduction to HTML (Hypertext Markup Language)
What is HTML - An Introduction to HTML (Hypertext Markup Language)
 
jQuery
jQueryjQuery
jQuery
 
AngularJS
AngularJSAngularJS
AngularJS
 
Integration patterns in AEM 6
Integration patterns in AEM 6Integration patterns in AEM 6
Integration patterns in AEM 6
 
JQuery introduction
JQuery introductionJQuery introduction
JQuery introduction
 
Angular js PPT
Angular js PPTAngular js PPT
Angular js PPT
 
Why Vue.js?
Why Vue.js?Why Vue.js?
Why Vue.js?
 
Document object model
Document object modelDocument object model
Document object model
 
Better web apps with React and Redux
Better web apps with React and ReduxBetter web apps with React and Redux
Better web apps with React and Redux
 
React dom
React domReact dom
React dom
 
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepJava Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By Step
 

Similar to Develop advance joomla! MVC Component for version 3

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
 
WordPress Structure and Best Practices
WordPress Structure and Best PracticesWordPress Structure and Best Practices
WordPress Structure and Best Practicesmarkparolisi
 
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
 
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
 
Unchain Your Web Development With Django
Unchain Your Web Development With DjangoUnchain Your Web Development With Django
Unchain Your Web Development With DjangoJoey Wilhelm
 
Implement rich snippets in your webshop
Implement rich snippets in your webshopImplement rich snippets in your webshop
Implement rich snippets in your webshopArjen Miedema
 
JoomlaEXPO Presentation by Joe LeBlanc
JoomlaEXPO Presentation by Joe LeBlancJoomlaEXPO Presentation by Joe LeBlanc
JoomlaEXPO Presentation by Joe LeBlancJohn Coonen
 
Joomlapresentation
JoomlapresentationJoomlapresentation
Joomlapresentationjlleblanc
 
Joomlapresentation
JoomlapresentationJoomlapresentation
Joomlapresentationguestf44ffc
 
Django Templates
Django TemplatesDjango Templates
Django TemplatesWilly Liu
 
Installation of Joomla on Windows XP
Installation of Joomla on Windows XPInstallation of Joomla on Windows XP
Installation of Joomla on Windows XPRupesh Kumar
 
Joomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic TemplatesJoomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic TemplatesAndy Wallace
 
Joomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic TemplatesJoomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic TemplatesChris Davenport
 
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
 
WordPress 3.0 at DC PHP
WordPress 3.0 at DC PHPWordPress 3.0 at DC PHP
WordPress 3.0 at DC PHPandrewnacin
 

Similar to Develop advance joomla! MVC Component for version 3 (20)

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
 
WordPress Structure and Best Practices
WordPress Structure and Best PracticesWordPress Structure and Best Practices
WordPress Structure and Best Practices
 
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
 
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
 
Django crush course
Django crush course Django crush course
Django crush course
 
Unchain Your Web Development With Django
Unchain Your Web Development With DjangoUnchain Your Web Development With Django
Unchain Your Web Development With Django
 
Creating a basic joomla
Creating a basic joomlaCreating a basic joomla
Creating a basic joomla
 
Implement rich snippets in your webshop
Implement rich snippets in your webshopImplement rich snippets in your webshop
Implement rich snippets in your webshop
 
upload_test
upload_testupload_test
upload_test
 
JoomlaEXPO Presentation by Joe LeBlanc
JoomlaEXPO Presentation by Joe LeBlancJoomlaEXPO Presentation by Joe LeBlanc
JoomlaEXPO Presentation by Joe LeBlanc
 
Joomlapresentation
JoomlapresentationJoomlapresentation
Joomlapresentation
 
Joomlapresentation
JoomlapresentationJoomlapresentation
Joomlapresentation
 
Building Templates for Joomla
Building Templates for JoomlaBuilding Templates for Joomla
Building Templates for Joomla
 
Django Templates
Django TemplatesDjango Templates
Django Templates
 
Installation of Joomla on Windows XP
Installation of Joomla on Windows XPInstallation of Joomla on Windows XP
Installation of Joomla on Windows XP
 
Joomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic TemplatesJoomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic Templates
 
Joomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic TemplatesJoomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic Templates
 
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
 
WordPress 3.0 at DC PHP
WordPress 3.0 at DC PHPWordPress 3.0 at DC PHP
WordPress 3.0 at DC PHP
 
Django
DjangoDjango
Django
 

Recently uploaded

Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 

Recently uploaded (20)

YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 

Develop advance joomla! MVC Component for version 3

  • 1. Develop Advance 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
  • 2. Meet my Joomla! Family gunjan.ce2009@gmail.com
  • 3. Time to play with the Database Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
  • 4. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Create two files: 1. admin/sql/install.mysql.utf8.sql 2. admin/sql/updates/mysql/0.0.6.sql Important: #__schemas table will be used for upgrades
  • 5. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Adding a new field type: type="helloworld" Field file path Field Custom Type: helloworld Notice that it was Before list
  • 6. Let’s create field at admin/models/fields/helloworld.php Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Parent field type Same as filename File Name should be same as Field type name Class name prefix Should be same as filename
  • 7. Continue with… admin/models/fields/helloworld.php Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Overriding parent class for HTML select list options. Get Database Object Joomla Query Language functions Looping to create options array JHTML options type value text
  • 8. Display the chosen message from field type in menu using Database Table Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
  • 9. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Create the admin/tables/helloworld.php file Table Name Primary Key
  • 10. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Modify the site/models/helloworld.php file Return the table instance Add new getTable function
  • 11. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Modify the site/models/helloworld.php file Update getMsg function to get Message from Database Get message id from request. Notice that here we are not using $_POST or $_GET Load table data from auto increment id
  • 12. Update in helloworld.xml Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel ZIP it
  • 13. Develop Basic Backend Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
  • 14. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Create the admin/helloworld.php file
  • 15. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Create the general controller admin/controller.php file Set Default view of component Component prefix. Typically name of component
  • 16. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Create the view admin/views/helloworlds/view.html.php file Parent ClassView NameComponent Name as class prefix Call Model get Item function and pagination function to support pagination
  • 17. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Create the layout admin/views/helloworlds/tmpl/default.php file
  • 18. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Create the sub-layout admin/views/helloworlds/tmpl/default_head.php file
  • 19. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Create the sub-layout admin/views/helloworlds/tmpl/default_body.php file
  • 20. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Create the sub-layout admin/views/helloworlds/tmpl/default_foot.php file
  • 21. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Create the Model admin/models/helloworlds.php file Parent class for listing Function of joomla. getListQuery function return query object
  • 22. Review helloworld.xml Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel ZIP it
  • 23. • Language files naming conventions: –For components • en-GB/en-GB.com_helloworld.ini –For Menus • en-GB/en-GB.com_helloworld.sys.ini Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Adding Language Translation Files
  • 24. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Language File Naming Pattern For Example: en-GB : Language code for English (UK) gu-IN : Language code for Gujarati (India) hn-IN : Language code for Hindi (India) <language code>-<country code>
  • 25. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Language File Naming Pattern For Example: en-GB : Language code for English (UK) gu-IN : Language code for Gujarati (India) hn-IN : Language code for Hindi (India) <language code>-<country code> <language code>-<country code>.com_<component_name>.[type].ini For Example: en-GB.com_helloworld.ini gu-IN.com_helloworld.ini ---------------------------------------- en-GB.com_helloworld.sys.ini Gu-IN.com_helloworld.sys.ini
  • 26. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Language String Pattern For Example: COM_HELLOWORLD="Hello World!" COM_HELLOWORLD_DESCRIPTION="This is the Hello World description" COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE="Hello World" COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC="This view displays a selected message" COM_HELLOWORLD_MENU="Hello World!" <language_key>=“<language_string_value>”
  • 27. Language File Location Options in helloworld.xml file Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel
  • 28. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Language File Naming Pattern
  • 29. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel or simply in ROOT
  • 30. Update helloworld.xml Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel ZIP it
  • 31. Joomla! User Network Ahmedabad Gunjan Patel @ergunjanpatel Any Questions?