Mercurial > hg > extraction-interface
view develop/classes/basecontroller.php @ 38:4b3da4802998 extractapp
config for localgazetteers-dev
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Fri, 06 Mar 2015 17:56:48 +0100 |
parents | ac77748bb813 |
children |
line wrap: on
line source
<?php // 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; public function __construct($action, $urlvalues, $postdata) { $this->action = $action; $this->urlvalues = $urlvalues; $this->postdata = $postdata; } public function ExecuteAction() { return $this->{$this->action}(); } protected function ReturnView($viewmodel, $fullview) { $viewloc = 'views/' . get_class($this) . '/' . $this->action . '.php'; if ($fullview) { require('views/maintemplate.php'); require($viewloc); } else { require($viewloc); } } protected function ReturnView_localtest($viewmodel, $fullview) { $viewloc = 'views/' . get_class($this) . '/' . $this->action . '.php'; if ($fullview) { require('views/maintemplate_local.php'); require($viewloc); } else { require($viewloc); } } } ?>