Framework - amadeus-web-archives/MicroVC GitHub Wiki

The Framework has 5 files.

bootstrap.php

This file is called by index.php. It includes other files, loads the app config, resolves and executes the Controller.

controller.php

This is the base class for controller. It lets you set the view, template and any head variables.

db.php

It connects (only if a db is configured) to mysql with the given db name.

db_select($sql, $returntype)

It uses the 3rd party (Code Igniter) db_mysql_result.php class to execute the code. If $returntype is not specified, it reuturns this 3rd party class which has properties for result_array and result_object. To get one of these directly as the result, you can set the returntype to array/arraysingle/object.

functions.php

Contains core functions like

site_file($rel)

Returns a file path relative to the site root. Overload returns contents directly.

site_url($rel)

Returns a url relative to the site root. Includes subfolders, not hostname.

view.php

These are methods used by the view.

site_info($name)

Returns the site info provided in the settings.

root_url($rel, $timestamp, $return)

Returns / echoes file paths relative to the "_" wwwroot folder (that contains css / images / js) By default, it includes the ?timestamp to the url.

new_table($headings, $atts)

Returns the 3rd party (Code Igniter) table helper class, initialized with the headings and attributes given, and configured to alternate rows and show border.