BackendPro User Guide Version 0.6.1


File System

The following topics are discussed below:

Model-View-Controller

BackendPro is based on the Model-View-Controller development pattern. It allows parts of the code to be separated and reused throughout the application. Please read the following page for more information on CodeIgniter and MVC.

Matchbox

Now you will read through this user guide that BackendPro uses Matchbox. So what is it? Well as said above BackendPro uses the MVC pattern to separate files. Matchbox allows another separation called modules. Its best to explain with an example

Lets say our CI application has the following few files for a small website:

System
    Application
        Controllers
            Home.php
            Widgets.php
            Pages.php
            Contacts.php
        Models
            Widget_model.php
            Page_model.php
            Contacts_model.php
        Views
            Widget_view.php
            Page_view.php
            Contacts_view.php

Now the above is all good for a small website. But lets say we have 15 controllers and 15 models etc. Well its going to get very busy in those folders very fast. So matchbox and its modules allows you to group the files further as seen below:

System
    Application
        Controllers
            Home.php
        Models
        Views
Modules
    Page
        Controllers
            Page.php
        Models
            Page_model.php
        Views
            Page_view.php
    Widgets
        Controllers
            Widgets.php
        Models
            Widget_model.php
        Views
            Widget_view.php
    Contacts
        Controllers
            Contacts.php
        Models
            Contact_model.php
        Views
            Contact_view.php

Now it may look more complicated but you know instantly where the widget files are. Another large advantage of using modules is if you ever need to reuse a part in another application. Say the Contact code. You don't need to go searching for all the files required to make it work.

Assets

An asset is a useful file used by the application. Examples are CSS/JS files, icons and images. BackendPro uses a unique asset management feature which allows all of these assets to be loaded and used without the developer having to worry about the nitty gritty code.

All assets can be located in the Assets folder and then in the following structure:

Assets
    Admin
        JS
        Images
        CSS
    Public
        JS
        Images
        CSS
    Images
    Shared
        JS
        Icons
        Images
        CSS

You can separate which assets are for the admin/public area only or which are shared between them.