Mercurial > hg > extraction-interface
diff classes/basecontroller.php @ 77:97c1e5102a22 extractapp
New: export table for a file from LGService
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Thu, 16 Apr 2015 14:53:22 +0200 |
parents | 886f43b26ee2 |
children | f1f849d31272 |
line wrap: on
line diff
--- a/classes/basecontroller.php Mon Apr 13 15:43:59 2015 +0200 +++ b/classes/basecontroller.php Thu Apr 16 14:53:22 2015 +0200 @@ -1,8 +1,11 @@ <?php -// an instance of the BaseController class can't be created directly; -// it can only be extended/inherited by other classes +/** +* An instance of the BaseController class can't be created directly. +* It can only be extended/inherited by other classes. +*/ + abstract class BaseController { - + protected $urlvalues; protected $action; @@ -17,6 +20,15 @@ } protected function ReturnView($viewmodel, $fullview) { + /** + * Return the corresponding view in the views folder. + * We use the same class name as the folder's name and action name as the file's name in the folder hierarchy. + * In this design, we can require the corresponding views php code by defining controller and action in url. + * + * If you also require the maintemplate.php, which now only contains scripts that need to be inclued, set $fullview to be true; + * otherwise, the maintemplate.php will not be applied. + */ + $viewloc = 'views/' . get_class($this) . '/' . $this->action . '.php'; if ($fullview) { require('views/maintemplate.php'); @@ -27,6 +39,10 @@ } protected function ReturnView_localtest($viewmodel, $fullview) { + /** Return the corresponding view in the views folder. + * + * This is only been used when developing on local machine. + */ $viewloc = 'views/' . get_class($this) . '/' . $this->action . '.php'; if ($fullview) { require('views/maintemplate_local.php');