![Gitter](https://badges.gitter.im/Join Chat.svg)
Aleph is a very simple PHP framework for very small sites.
Install via composer:
$ composer require lastguest/aleph -o
Or download only the framework file
Or remote include the framework file: (needs allow_url_include = true
in php.ini)
<?php
include "https://raw.githubusercontent.com/lastguest/aleph/master/src/aleph.php";
<?php
include "aleph.php";
get('/',function(){
echo "<h1>Hello!</h1>";
});
// If you return an array or an object it will served as JSON
get('/api/todos',function(){
return [
[ "id"=>1, "text"=>"Write documentation" ],
[ "id"=>2, "text"=>"Smile" ],
[ "id"=>3, "text"=>"Play more games" ],
[ "id"=>4, "text"=>"Conquer the World" ],
];
});
database('init','mysql:host=localhost;dbname=test','root','root');
$uid = sql_value('select id from users where username = ? limit 1', array($username));
$user = sql_row('select * from users where username = ?', array($username));
echo $user->email;
sql_each('select * from users', function($user){
echo "<li><a href="mailto:{$user->email}">{$user->name}</a></li>";
});
Passing parameters:
sql_each('select * from users where activated = ?', function($user){
echo "<li><a href="mailto:{$user->email}">{$user->name}</a></li>";
}, array('YES'));
if ( sql('delete from users where id = ?',array(123)) ) echo "User deleted.";
======================
How to get involved:
- Star the project!
- Answer questions that come through GitHub issues
- Report a bug that you find
Core follows the GitFlow branching model. The master
branch always reflects a production-ready state while the latest development is taking place in the develop
branch.
Each time you want to work on a fix or a new feature, create a new branch based on the develop
branch: git checkout -b BRANCH_NAME develop
. Only pull requests to the develop
branch will be merged.
Pull requests are highly appreciated.
Solve a problem. Features are great, but even better is cleaning-up and fixing issues in the code that you discover.
Core is maintained by using the Semantic Versioning Specification (SemVer).
Copyright 2014 Stefano Azzolini under the MIT license.