Features
- Need the Router Rule.
- Backender and Frontender can be separated ambiguous.
- Backender makes model and business logic in model.
- Frontender shoould use data from backender.
- Need to add the configure of apache for rewrite.
- When you use the ajax , you can choose the view page to be or not.
- If you want to handle the URL, you can handle the URL very easy without setting in apache.
How to Set up
1) add the rewrite rule to apache like below.
2) copy the thule's views directory to apache doc-root directory.
3) set the configure file.
4) set the gate.php to fit your environment.
5) make router rule.
Discription
If you want router access, you have to do something to install.
Check dev_config.php
And check the config/dev_config.php like below
Default router_uri_name, if the variable is empty, apache setting should be below.
$config['router_uri_name']='';
Apache setting
RewriteEngine on
RewriteCond %{REQUEST_URI} !(.+\.jpg|.+\.gif|.+\.awf|.+\.png|.+\.js|.+\.css)$
RewriteCond $1 !^(gate\.php|robots\.txt)
ReiteRule ^(.*)$ /gatehp/$1?%{QUERY_STRING} [L]
uri=$1&.. <- variable is router_uri_name
$config['router_uri_name']='uri';
Apache setting
Below must be added to http.conf.
RewriteEngine on
RewriteCond %{REQUEST_URI} !(.+\.jpg|.+\.gif|.+\.awf|.+\.png|.+\.js|.+\.css)$
RewriteCond $1 !^(gate\.php|robots\.txt)
ReiteRule ^(.*)$ /gatehp?uri=$1&%{QUERY_STRING} [L]
And then have a look config/router_config.php , you can find a default setting and samples.
Set Router Default Rule
config/router_config.php
$config['router_access_mode']= array("Controller","View");
There are many options for router.If you want to know , go to the Router Chapter.