The Controller

The MBF_Controller is a simple class that will handle the page request and send the response back to the browser. This process has the following steps:

  • Identify a website based on the requested domain
  • Identify a page in the website based on the URL (remember more than one website may coexist)
  • Identify if the page may be displayed which depends on factors like the page being set as visible, as public and the user being logged in
  • Identify page placeholders (this website uses a template with "top", "content" and "sidebar" placeholders)
  • Identify sections in each placeholder which will automatically instantiate and process modules assigned to each section and as well indentify if the module may be displayed. Modules, like pages may be set as public, which means that there is enough flexibility to put a private module in a public page. In this case only logged in users would see the private content.
  • Each module in a section will generate its own HTML
  • Finally, the controller will pass a MBF_Entity_Page object to the Smarty engine  which is responsible for putting the HMTL for the conplete page together and send it back to the browser.