Hello World!
this demo show the minimal code to run a lit app.
config you web server, rewrite all request to index.php
apache
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
nginx
try_files $uri /index.php?$args;
Router Basic
this demo show how to route your app.
-
return true;within the route callback to break route chain -
Lit_Route_Regexsupport route via regex on request uri- catch the regex match result with
$app->context(Lit_Route_Regex::MATCHES)
- catch the regex match result with
-
set http status code via
$litHttpView->status
Template, Layout, everything your VIEW
this demo show how to roll your View Layer.
- implement
Lit_ITemplateto adapt your template engine, providing therender($template, $data)method - extends
Lit_Http_View_Template, overridedata()andtemplate()method to provide $data and the template engine - create instance for you View class, use it as the Lit_Result
- Layout maybe implemented by override
output()method, to output some common part