-
Notifications
You must be signed in to change notification settings - Fork 0
Site Components
The /site/ folder is made up of three components. They make up the MVC design pattern.
###1) Controller [./site/controller/]
Links the above models with the view. Handles all process of data and basically gets everything ready for the view to get rendered.
###2) View [./site/view/]
The output (usually html) that the customer sees. Try to have as little logic in here as possible.
###3) Model [./site/model/]
Where all logic belongs. Try to make each method as single purpose and small (number of lines) as possible. Try not to let your classes (the entire file get too big).
Please be aware of /site/model/xesm.php. This is an extending class and built to work directly with the XESM system. It does the following things on construct
Populates
$c (object) = container
$name (string) = name of class
$title (string) = Nicely formatted name of class
$item (object) = item object with same name as class
$query (object) = query object same name as class
It also provides the following functions
$model->init($data) = easy way to initialize the class (data is optional)
$model->assign($data) = populates the item with data
$model->id() = gets items id
$model->mode() = determine status of item (is it populated = new, if it is = edit)
$model->list_id() = gets a list of ids from item properly field (usually $item->config["type"]=join or link)
$model->output() = easy debug data for the entire model object