Extra Light PHP Framework
Quick start
Download
See the download page
Configuration
1. Open application/config/config.php
$config['base_url'] = 'http://localhost/elf_php/'; //set apps base url
$config['default_controller'] = 'main'; //the name of the main conroller
$config['url_suffix'] = '.html'; //url suffix
$config['index_page'] = 'index.php'; //name of the bootstrap
$config['mod_rewrite'] = TRUE; // :)
$config['permited_uri_chars'] = 'a-z0-9(),.|_';
$config['default_language'] = 'english';
$config['logger_console_display'] = 'none';
$config['allow_GET'] = FALSE; //true if you will use $_GET
$config['environment'] = 0;
$config['dev_ip'] = array();
$config['use_ssl'] = FALSE;
Create the controller
1. Create a file called main.php in application/controllers
2. Open application/controllers/main.php and write:
<php if (!defined('LIB_DIR')) exit('Access Forbidden');
class Main extends Controller
{
function Main()
{
parent::__construct();
}
function index()
{
$view['title'] = 'Foo';
$view['content'] = 'Bar';
View::render('main', $view);
}
}
?>
Create the view
1. Create a file called main.php in application/views
2. Open application/views/main.php and write:
<html>
<head>
<title><?=$title?></title>
</head>
<body>
<h1><?=$title?></h1>
<p><?=$content?></p>
</body>
</html>
This is all
Now visit http://localhost/elf_php/