轻量级 PHP 框架 TinyLara 更新:更优雅 附中文介绍

发布时间:2019-08-08 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了轻量级 PHP 框架 TinyLara 更新:更优雅 附中文介绍脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

TinyLara

轻量级 PHP 框架 TinyLara 更新:更优雅 附中文介绍

  ______    _                      __
 /_  __/   (_)   ____    __  __   / /   ____ _   _____  ____ _
  / /     / /   / __   / / / /  / /   / __ `/  / ___/ / __ `/
 / /     / /   / / / / / /_/ /  / /___/ /_/ /  / /    / /_/ /
/_/     /_/   /_/ /_/  __, /  /_____/__,_/  /_/     __,_/
                      /____/

中文介绍

TinyLara 是一个轻量级 PHP 框架,基于 Composer,可以看成 Laravel 的精简版。官方网站:http://tinylara.com/

GIThub

Github 项目地址:https://github.com/TinyLara/TinyLara

开始使用

下载:

git clone https://github.COM/TinyLara/TinyLara
cd TinyLara

或者

wget https://codeload.github.com/TinyLara/TinyLara/legacy.zip/master
unzip master
cd TinyLara*

安装依赖包:

composer update

修改数据库配置文件 app/database.php,将 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');
}

运行项目:

@H_360_260@cd public && php -s 127.0.0.1:3000

访问 @L_777_6@

TinyLara 已经跑起来了!


特性

  1. 微型路由包 TinyLara/TinyRoute, 基于性感而快速的 codingbean/macaw
  2. MVC 架构
  3. 采用地球上最强大的 PHP ORM 之一:Laravel Eloquent
  4. 优雅而强大的 Laravel 式的视图加载器
  5. 支持原生 PHP 操作 Redis,无需安装任何 PHP 扩展。
  6. 一行代码即可发送 SMTP 邮件。

协议

TinyLara 采用 MIT license 协议分发,衍生项目除了必须采用 MIT 协议之外无任何限制。


English Version

TinyLara is a Simple PHP Framework based on Composer, looks like a Tiny Laravel.

Start

Download:

git clone https://github.com/TinyLara/TinyLara
cd TinyLara

OR:

wget https://codeload.github.com/TinyLara/TinyLara/legacy.zip/master
unzip master
cd TinyLara*

Install dePEndencies:

composer update

Then modify app/database.php with right information and import demo.sql.

Just see:

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');
}

Run:

cd public && php -S 127.0.0.1:3000

Visit http://127.0.0.1:3000/

It's already running!


Features

  1. Tiny router TinyLara/TinyRoute, based on fast and sexy codingbean/macaw
  2. MVC Architecture
  3. One of the Most powerful PHP ORM on Earth: Laravel Eloquent
  4. Powerful Laravel-style views loader
  5. Redis ready in Laravel-style
  6. Handy SMTP mailer

License

The TinyLara framework is open-sourced Software licensed under the MIT license

脚本宝典总结

以上是脚本宝典为你收集整理的轻量级 PHP 框架 TinyLara 更新:更优雅 附中文介绍全部内容,希望文章能够帮你解决轻量级 PHP 框架 TinyLara 更新:更优雅 附中文介绍所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。