10 Structure - goldenice/Kamele-Framework-2 GitHub Wiki
Kamele Framework works with a Model-View-Controller based structure, which separates business logic from presentation code. Models and controllers consist of PHP code, whereas views are mostly HTML and some Kamele templating language. The two are connected almost automatically by the controller class.
Controllers
Controllers in Kamele are able to load views for you, just override the constructor and set $view
to true, and $viewpath
to the path of the view you want to load. The complete example code can be found in the default class \Application\Controllers\Home
in the download. Controllers provide the main logic for the application.
Models
These interact with the database and model objects and actions. Models are used mainly as interface to the database and should be handled as such.
Views
Views consist of static HTML and some Kamele templating language. This templating language can be used to dynamically shape views. More on this on the Kamele Templating Language page.
Libraries
In Kamele 1.3 libraries were introduced. Until 2.0 they were located in /system/lib
. As per Kamele 2.0 they have moved to their own directory, namely /libraries