Understanding Zo2 structure

1. Introduction


Since ver 1.4.2, Zo2 Framework will follow PSR-2 format. It means that all PHP class name & filename can be autoloaded easily by following the right format.

After Installation, you should get to know the folder structure of the framework which shows you where and how to work with files.

For further details, please look into this Diagram of Framework Structure

2. Framework


Note Please use Xmind software to open above diagram!

Zo2 Plugin Folder Structure

/plugins/system/zo2/formfields

/plugins/system/zo2/framework

├──assets /* Zo2 core assets directory */ 
│        ├──vendor /* 3rd parties assets */ 
│        │    ├──bootstrap 
│        │    │    ├──2.3.2 
│        │    │    │    ├──css 
│        │    │    │    ├──img 
│        │    │    │    ├──js 
│        │    │    ├──addons 
│        │    │    │    ├──bootstrap-colorpicker 
│        │    │    │    │    ├──css 
│        │    │    │    │    ├──img 
│        │    │    │    │    │    ├──bootstrap-colorpicker 
│        │    │    │    │    ├──js 
│        │    │    │    ├──bootstrap-rtl 
│        │    │    │    │    ├──css 
│        │    │    │    │    ├──fonts 
│        │    │    │    │    ├──js 
│        │    │    │    ├──gridsystem 
│        │    │    │    ├──css 
│        │    │    │    ├──fonts 
│        │    │    │    ├──js 
│        │    ├──font-awesome 
│        │    │    ├──css 
│        │    │    ├──fonts 
│        │    ├──fontello 
│        │    │    ├──css 
│        │    │    ├──font 
│        │    ├──fontselect 
│        │    ├──jRange 
│        ├──zo2 /* Zo2 core assets */ 
│        │    ├──css 
│        │    ├──development /* Less and js will be compile */ 
│        │    │    ├──js 
│        │    │    ├──less 
│        │    │    │    ├──admin 
│        │    │    │    ├──site 
│        │    ├──images 
│        │    │    ├──list 
│        │    │    ├──prettyPhoto 
│        │    │    │    ├──dark_rounded 
│        │    │    │    ├──dark_square 
│        │    │    │    ├──default 
│        │    │    │    ├──facebook 
│        │    │    │    ├──light_rounded 
│        │    │    │    ├──light_square 
│        │    ├──js 
├──helper /* Helper classes. Prefix Zo2Helper to follow up PSR-2 */ 
├──html /* Template layout files */ 
│        ├──admin 
│        │    ├──body 
│        │    │    ├──sidebar 
│        │    │    │    ├──builder 
│        │    ├──top 
│        ├──fields 
│        ├──layouts 
│        ├──site 
│        ├──utilities 
│        ├──zo2 
├──includes /* Core required files. These files are none override-able */ 
├──language /* Libraries to override Joomla! process. Will be moved soon */ 
├──model 
├──utilities /* Will be moved soon */ 
├──vendor /* 3rd party classes */ 
│        ├──ganon 
│        ├──less 
│        ├──minify

We recommend you not to customize files of the plugin, all your work should be operated in zo2_hallo template. Location: JPATH_ROOT ./plugins/system/zo2/

  • formfields:
  • framework: Framework root dir. Everything inside this directory will follow up PSR-2
    • assets
      • vendor: 3rd party assetted by following below structure
        • name
          • version
      • zo2
        • css
        • js
        • images
        • development: All less & js must be developed inside this directory
          • less
          • js
      • default.json: Assets config file
      • joomla25.json: Assets config file for Joomla! 2.5
      • json: Build assets config file
      • helper: Helper will be used for common methods. Classname Zo2Helper
        • assets.php
        • compiler.php
        • googlefonts.php
      • html: Containing all html template files. In v2 this would be a part of html:// for overridden
        • admin: For backend. Will be removed soon and follow custom FormField
        • layouts
        • mod_login: Should be removed soon
        • mod_menu: Should be removed soon
        • utilities: Utilities template
          • bottomscript.php
          • styleswitcher.php
        • zo2: Since v1.4.2. For core template files
      • imager: Imager classes to process image
      • includes: Core files required. These files are not able to be overridden
      • joomla: Joomla template classes. Service for joomla
        • template.php
      • service: 3rd party service classes. Will be moved into addons for v2
      • utilities: Will be moved into addons
      • vendor: 3rd party classes.
    • ajax.php:: Not finished yet. Would be done in v2
    • assets.php:: Assets classed. Service for load & render assets
    • component.php:: Will be removed soon
    • controller.php:: Will be removed soon
    • imager.php:: Image class
    • layout.php:: Layout class. Service for layout builder process. Must be constructed with layout properties
    • logs.php:: Logging system class
    • megamenu.php:: Megamenu class. Service to render Megamenu layout. Will be moved as child class of Zo2Layout
    • profile.php:: Profile object class
    • style.php
    • template.php:: Template fetch
    • utilities.php

3. Template


Zo2 Hallo Template Folder Structure

/templates/zo2_hallo

├──assets /* Template asset files */ 
│        ├──profiles /* Stored profile files */ 
│        ├──vendor 
│        │    ├──html5shiv 
│        ├──zo2 /* Zo2 assets */ 
│        │    ├──css 
│        │    ├──development /* Less & js source before compile */ 
│        │    │    ├──js 
│        │    │    ├──less 
│        │    │        ├──core 
│        │    ├──images 
│        │    │    ├──background-patterns 
│        │    │    ├──presets 
│        │    │    ├──typo 
│        │    ├──js 
├──html /* Joomla! template override */ 
│        ├──com_contact 
│        │    ├──categories 
│        │    ├──category 
│        │    ├──contact 
│        │    ├──featured 
│        ├──com_content 
│        │    ├──archive 
│        │    ├──article 
│        │    ├──categories 
│        │    ├──category 
│        │    ├──featured 
│        │    ├──form 
│        ├──com_search 
│        │    ├──search 
│        ├──com_users 
│        │    ├──login 
│        │    ├──profile 
│        │    ├──registration 
│        │    ├──remind 
│        │    ├──reset 
│        ├──layouts 
│        │    ├──joomla 
│        │        ├──content 
│        ├──mod_articles_categories 
│        ├──mod_breadcrumbs 
│        ├──mod_finder 
│        ├──mod_login 
├──includes /* Required core file of template */

Location: JPATH_ROOT/templates/

  • assets: Also can be used as assets:// namespace ( override able )
  • components: Will be removed soon
  • html: Joomla template override. Also can be used as html://
  • includes: Required files
    • bootstrap.php:: Used to init. All register, declare will be placed here
  • layouts
  • index.php:: Joomla index file