<?
class class_name {
?>
The model/data objects are usually made part of the global $ilance variable in the form of
$ilance->model = construct_object('api.class_name');
The ‘.’ notation contained there in is a file path starting in the functions directory. We keep all of our custom classes in the ‘functions/custom/’ folder and hence we invoke them as:
$myobject = construct_object('custom.myobject_class');
Note, that the file name has the same naming convention class.myobject_class.inc.php.
Finally the “view” portion of the content delivery is handled by a series of lines that are delivery at the end of each if statement logic block.
The first line loads the “template” file into the $ilance→template object. The template file holds the structured html and has a series of place holders for the variables that the script has been processing in the form of {variable}, note: there is no ‘$’.
Next, for variables that are part of an array and are represented in the template file that way, i.e. {array[key]} the parse_hash method is used. Next, the <if condition="<!-- condition -- >"><else/></if> blocks are processed and parsed. These are iLance specific structures that allow in-template processing logic to take place.
The last processing is to call the pprint method which takes a list of all of the variables the script just processed (the ones that need to be shown). The inner workings then replace those vars in the template with match names.
That is the iLance MVC structure in a nut shell.