I wrote this as part of a router function to replace code that wasn't working in old php environments. Later I added the Views Markup.
You'll need to setup htaccess with the following routering instructions
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
- index.php
- /components
- /controllers
- /views
- /framework
router.php Used as a URL router and class loader /controller/action/param1/param2/ ... ?get1=1,get2=2 ...
The framework folder contains all the code to manage views and controllers.
##Components Any php files here are loaded at runtime
Add controller classes here using the template
<?php
class Template_Controller{
public function index($param1 =null, $param2=null){
echo "index hit";
}
}
?>
Views are located in the view folder and withe default path of controllor/action.php Views are automatically rendered, but that can be turned off in the controllor using the following
$this->autoRender = false;
You can manually call views
$this->render('index');
View variables are set using the set command, similar to cakephp
$this->set('view_var_name', "Variable Value");
The is wrapping HTML structure behind the view files is located in views/template.php