Personal tools

FrameIT Architecture

From Deep Thought

Jump to: navigation, search

Details on how the FrameIT Architecture is hung together.

Contents

Request Handling

All requests to the base URL go to the /application/index.php application.

image:Request_model.jpg

Dispatcher

class: wij_dispatcher purpose: handles url parsing

Custom routing channels can be handled using regular expressions in config/routing.php.

By default, urls are in this format:

domain.com/className/methodName/variables

className is appended with _controller and if a matching class is found, it is instantiated. If no class is found, error_controller is called. if no class is supplied, index_controller is called.

Controller

class:wij_controller purpose: manage the output via the view combined with methods and properties

Gets the template & sets the attributes.

Template

main article: wij_template

class:wij_template purpose: process the view via template files

One of these is created for each template parsed.

This is not a singleton because it carries attributes and path over from the controller.

This will crawl "up the tree" from the lowest level method, to the class, to the application level templates. If it can't find a suitable matching template then the view will display the error template.

Template Tags

class:wij_template method: parse_tag

All "smart" tags take the form <%<operator><variable>%>

Available operators are:

  • @ include another template file

example: <%@header%>


  • = display a variable

example: <%=myvar%>


  •  ! execute a method (function)

example: <%!crystalmeth%>

Related Links

Frameit