Beispiel #1
0
 private function template_path(){
   $cls= to_lowercase(get_class($this));
   $name= str_replace("_controller","", $cls);
   return join("/", [
     $name,      
     $this->action_name
   ]);
 }
Beispiel #2
0
 function load_controllers(){
   spl_autoload_register(function($classname){
     if(!preg_match("/\A(.+)Controller\z/", $classname, $matches))return;
     $name= to_lowercase($matches[1]) . "_controller.php";
     if(!is_readable($path= join("/", [App::$path, CONTROLLERS, $name])))
       throw new ControllerNotFound;
     require $path;
   });
 }