DMS pages are based on a page template.  The Template class is a CodeIgniter that is stored in the system library (Template.php).


The version used by DMS is from 2008 and based on CodeIgniter 2.x.  At the time of this writing a version 3.x was in GitHub (search for Template.php).


The concept is pretty simple:


  • Each branch of DMS (RA, Events, Shop) has a master template found in its views directory
  • Each template gives the overall structure of the page
    • doctype, head, body, meta, script and link HTML constructs
    • these are laid out using W3 schools Website Layout mechanism (similar to Bootstrap)
    • a series of PHP variables (called regions) supply content at various places in the template
      • $content is the main content for a page
      • menus on the page include $sitemenu2, $mainmenu, $iconmenu, $footmenu
      • $submenu handles the red tab menu
      • program year control
      • status display with message back to the user
    • each branch has a template.php file in its config directory that describes the data that need to be collected for the template
      • there is some documentation in the header
    • to render the page
      • the controller for the page generates $content
        • this gets passed to the template using $this->template->write_view
      • the controller invokes the template to render the page ($this->template->render)
      • template.render uses template.php to collect the other regions of the page 
      • template.render sends the entire page to the browser
  • A branch can have more than one template
    • a page can choose an alternate template by invoking $this->template->set_template
    • additional css can be added to the page by invoking $this->template->add_css
    • additional javascript can be added to the page by invoking $this->template->add_js