-
Notifications
You must be signed in to change notification settings - Fork 672
Developer Guide: ThinkUp's Model View Controller Implementation
finn edited this page Nov 1, 2010
·
7 revisions
ThinkUp does not use an MVC framework, but it does employ the Model-View-Controller design pattern.
-
Model – ThinkUp’s model objects live in
/thinkup/webapp/_lib/model/
. Model object filenames start with the prefixclass.
. For example, the Post object is located in theclass.Post.php
file.
-
View – ThinkUp’s views are Smarty templates, files with the
.tpl
extension, located in the/thinkup/webapp/_lib/view/
directory. As a general rule, HTML markup should never appear in a PHP file; only in a template file.
-
Controller – ThinkUp’s controllers live in
/thinkup/webapp/_lib/controller/
. Each controller should extend either ThinkUpController or ThinkUpAuthController. Extend ThinkUpAuthController only if the user should be logged in to perform the action. The PHP pages which the user requests in the browser only instantiate the appropriate controller, and echo the results of itsgo()
method.