Advance Component Development by Azrul Rahim

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Advance Component Development by Azrul Rahim - Presentation Transcript

    1. Azrul Rahim
      • 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
      • 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
      • All component is stored in /components/ folder
      • component/com_hello/
        • hello.php
      • JOOMLA 1.0
      • JOOMLA 1.5
    2.  
      • 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
      • http://dev.joomla.org/component/option,com_jd-wiki/Itemid,/id,tutorials:components/
      • Minimal code here. Execute the controller
      • Process user request
      • DO NOT
        • Do db calls
        • Echo anything!
      • Pass the execution to view
      • Extends JModel
      • Your method represent business logic
      • Render the output
      • Grab data from model
      • Have direct access to the default model
      • Layout file does the final HTML output
      default.php nogreetings.php
      • 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.
    3. More on Joomla! API
      • 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
      • Implement “Factory” design pattern
      • ::getApplication() (instead of global $mainframe)
      • ::getDBO();
      • ::getDocument();
      • Don’t just use JRequest::getVar( ….)
      • ::getWord(…)
      • ::getCmd(…)
      • ::getString(…)
      • ::getBool(…)
      • ::getFloat(…)
      • ::getInt(…)
    4. 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
      • Ensure UTF-8 integrity
        • Use JString:: functions
        • JString::strlen(…)
      • Support internationalization
        • JText::_(…)
        • JText::sprintf(…)
      • DO NOT use fopen, fread …
      • Use Joomla calls
        • JFolder
        • JFile
        • JPath
      • Display warning message
      $mainframe = JFactory::getApplication(); $mainframe->enqueuMessage(‘Warning’);
      • We want to fail fast!
      • Do not let error propagate to other part of the code
    5.  
      • http://developer.joomla.org
      • http://docs.joomla.org/Developers

    + coffeegroupcoffeegroup, 11 months ago

    custom

    1247 views, 0 favs, 2 embeds more stats

    Advance Component Development by Azrul Rahim presen more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1247
      • 1208 on SlideShare
      • 39 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 24
    Most viewed embeds
    • 34 views on http://oidacra.accionasolutions.net
    • 5 views on http://www.denver.cmsexpo.net

    more

    All embeds
    • 34 views on http://oidacra.accionasolutions.net
    • 5 views on http://www.denver.cmsexpo.net

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories