Junior is a project mainly written in PHP, it's free.
Really small framework for PHP. It may or may not be inspired by Sinatra (sans-built in webserver)
Junior is a really small PHP framework inspired by Sinatra. It consists of two PHP files (working on making it one), two directories and a .htaccess file
It supports friendly URLs using regular expressions, and uses a single layout file, rather than the more common header and footer include setup
<?php
require_once('lib/junior.php');
function route($request)
{
global $vars, $layout;
if(preg_match("/^$/", $request))
{
$layout = 'views/index_layout.php';
include('views/index.php');
}
elseif(preg_match("/^about$/", $request))
{
include('views/about.php');
}
elseif(preg_match("^/news/(d+)$", $request, $m))
{
$id = $m[1];
include('views/news.php');
}
else
{
show_404();
}
}
run();
?>
$layout - This sets the master layout for the request. Set it to false to not render a layout. Include the variable: $content somewhere in the layout and it will be replaced by the content of the rendered view
$vars - Because of PHP variable scoping, you can use this variable to set "global" variables for the layout file. We suggest a associative array