______ _ __ /_ __/ (_) ____ __ __ / / ____ _ _____ ____ _ / / / / / __ \ / / / / / / / __ `/ / ___/ / __ `/ / / / / / / / / / /_/ / / /___/ /_/ / / / / /_/ / /_/ /_/ /_/ /_/ \__, / /_____/\__,_/ /_/ \__,_/ /____/
TinyLara 是一个轻量级 PHP 框架,基于 Composer,能够当作 Laravel 的精简版。官方网站:http://tinylara.com/php
Github 项目地址:https://github.com/TinyLara/TinyLaralaravel
git clone https://github.com/TinyLara/TinyLara cd TinyLara
或者:git
wget https://codeload.github.com/TinyLara/TinyLara/legacy.zip/master unzip master cd TinyLara*
composer update
修改数据库配置文件 app/database.php
,将 demo.sql
导入数据库。github
config/routes.php :redis
Route::get('', 'HomeController@home');
更加优雅的邮件发送及视图调用接口:
app/controllers/HomeController.php :sql
public function home() { // mail sample Mail::to('foo@bar.io')->from('bar@foo.io') ->title('Foo Bar') ->content('Hello~~') ->send(); // redis sample Redis::set('key','value',3000,'ms'); echo Redis::get('key'); // view sample return View::make('home')->with('article',Article::first()) ->withTitle('TinyLara :-D') ->withFooBar('foo_bar'); }
cd public && php -S 127.0.0.1:3000
访问 http://127.0.0.1:3000/数据库
TinyLara 采用 MIT license 协议分发,衍生项目除了必须采用 MIT 协议以外无任何限制。架构
TinyLara is a Simple PHP Framework based on Composer, looks like a Tiny Laravel.app
git clone https://github.com/TinyLara/TinyLara cd TinyLara
OR:composer
wget https://codeload.github.com/TinyLara/TinyLara/legacy.zip/master unzip master cd TinyLara*
composer update
Then modify app/database.php
with right information and import demo.sql
.
config/routes.php :
Route::get('', 'HomeController@home');
app/controllers/HomeController.php :
public function home() { // mail sample Mail::to('foo@bar.io')->from('bar@foo.io') ->title('Foo Bar') ->content('Hello~~') ->send(); // redis sample Redis::set('key','value',3000,'ms'); echo Redis::get('key'); // view sample return View::make('home')->with('article',Article::first()) ->withTitle('TinyLara :-D') ->withFooBar('foo_bar'); }
cd public && php -S 127.0.0.1:3000
Visit http://127.0.0.1:3000/
The TinyLara framework is open-sourced software licensed under the MIT license