Your SlideShare is downloading. ×
Advance Component Development by Azrul Rahim
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Advance Component Development by Azrul Rahim

3,993
views

Published on

Advance Component Development by Azrul Rahim presentation given at CMS Expo in Denver, December 2008.

Advance Component Development by Azrul Rahim presentation given at CMS Expo in Denver, December 2008.

Published in: Technology

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,993
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
91
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Transcript

    • 1. Azrul Rahim
    • 2.
      • Developer of
        • JomComment & MyBlog
        • JomSocial ( www.jomsocial.com )
      • 3 years of Joomla! coding experience
      • Started with Joomla! 1.0 and now code exclusively for Joomla! 1.5
      • Slides co-written by Toby Patterson
    • 3.
      • Introduction to Joomla MVC
      • Business logic in Joomla
        • Examples
      • Some useful utilities and libraries
        • JFactory, JRequest, and others
      • Introduction to some advance topics
        • Error handling
        • Internationalization
    • 4.
      • All component is stored in /components/ folder
      • component/com_hello/
        • hello.php
    • 5.
      • JOOMLA 1.0
      • JOOMLA 1.5
    • 6.  
    • 7.
      • Model – manage data and logic.
        • All database calls should be here
      • View – render the data from model.
        • No business logic here please
      • Controller – control application flow
        • Interpret user request
        • Trigger appropriate model
        • Pass model to view
    • 8.
      • http://dev.joomla.org/component/option,com_jd-wiki/Itemid,/id,tutorials:components/
    • 9.
      • Minimal code here. Execute the controller
    • 10.
      • Process user request
      • DO NOT
        • Do db calls
        • Echo anything!
      • Pass the execution to view
    • 11.
      • Extends JModel
      • Your method represent business logic
    • 12.
      • Render the output
      • Grab data from model
      • Have direct access to the default model
    • 13.
      • Layout file does the final HTML output
      default.php nogreetings.php
    • 14.
      • Separate application control, data logic and view
      • The important concepts to take away are:
        • Controllers represent control logic;
        • Models represent business/data logic;
        • Views represent presentation logic;
        • Layouts are for markup language.
    • 15. More on Joomla! API
    • 16.
      • MVC – JController, JModel , JView
      • JRequest – grab user POST/GET/REQUEST data
      • JText
        • multi-language support
        • Use JText::_ ( ) and JText::sprintf( )
      • JFactory - access global objects
      • JUser – User object
    • 17.
      • Implement “Factory” design pattern
      • ::getApplication() (instead of global $mainframe)
      • ::getDBO();
      • ::getDocument();
    • 18.
      • Don’t just use JRequest::getVar( ….)
      • ::getWord(…)
      • ::getCmd(…)
      • ::getString(…)
      • ::getBool(…)
      • ::getFloat(…)
      • ::getInt(…)
    • 19. A string is series of characters. In PHP, a character is the same as a byte , that is, there are exactly 256 different characters possible. This also implies that PHP has no native support of Unicode. From php.net, definition of a string
    • 20.
      • Ensure UTF-8 integrity
        • Use JString:: functions
        • JString::strlen(…)
      • Support internationalization
        • JText::_(…)
        • JText::sprintf(…)
    • 21.
      • DO NOT use fopen, fread …
      • Use Joomla calls
        • JFolder
        • JFile
        • JPath
    • 22.
      • Display warning message
      $mainframe = JFactory::getApplication(); $mainframe->enqueuMessage(‘Warning’);
    • 23.
      • We want to fail fast!
      • Do not let error propagate to other part of the code
    • 24.  
    • 25.
      • http://developer.joomla.org
      • http://docs.joomla.org/Developers