====== Controller ====== ===== Built in controller ===== Built in controller includes following classes * controller/PageControllerUrl * controller/AbstractAction * controller/IndirectAction ==== Initializing the controller ==== $controller = new PageControllerUrl(__DIR__.'/action'); $controller->setErrorReporter($errorReporter); $content = $controller->runActions(); ==== URL to class mapping ==== Each url maps to corresponding class where directories are namespaces and files are classes. For example url **/users/add.html** maps to class **add** in namespace **\action\users** (assuming that root directory for action classes is named **action**). Directory url like '/users/' is the same as '/users/index.html'. ==== Namespaces ==== Action directory is the PSR-4 base for actions. i.e. if actions directory is 'action/', the /users/add.html action will go to 'action/users/' directory, the file will be 'add.php', the name space is 'action\users' and the class name is **add**: namespace action\users; class add extends nsfw\controller\AbstractAction{ //.... }