资讯专栏INFORMATION COLUMN

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

loonggg / 805人阅读

摘要:中文介绍是一个轻量级框架,基于,可以看成的精简版。官方网站项目地址开始使用下载或者安装依赖包修改数据库配置文件,将导入数据库。一行代码即可发送邮件。协议采用协议分发,衍生项目除了必须采用协议之外无任何限制。

TinyLara

</>复制代码

  1. ______ _ __
  2. /_ __/ (_) ____ __ __ / / ____ _ _____ ____ _
  3. / / / / / __ / / / / / / / __ `/ / ___/ / __ `/
  4. / / / / / / / / / /_/ / / /___/ /_/ / / / / /_/ /
  5. /_/ /_/ /_/ /_/ \__, / /_____/\__,_/ /_/ \__,_/
  6. /____/
中文介绍

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

Github

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

开始使用 下载:

</>复制代码

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

或者:

</>复制代码

  1. wget https://codeload.github.com/TinyLara/TinyLara/legacy.zip/master
  2. unzip master
  3. cd TinyLara*
安装依赖包:

</>复制代码

  1. composer update

修改数据库配置文件 app/database.php,将 demo.sql 导入数据库。

查看代码:

config/routes.php :

</>复制代码

  1. Route::get("", "HomeController@home");
更加优雅的邮件发送及视图调用接口:

app/controllers/HomeController.php :

</>复制代码

  1. public function home()
  2. {
  3. // mail sample
  4. Mail::to("foo@bar.io")->from("bar@foo.io")
  5. ->title("Foo Bar")
  6. ->content("Hello~~")
  7. ->send();
  8. // redis sample
  9. Redis::set("key","value",3000,"ms");
  10. echo Redis::get("key");
  11. // view sample
  12. return View::make("home")->with("article",Article::first())
  13. ->withTitle("TinyLara :-D")
  14. ->withFooBar("foo_bar");
  15. }
运行项目:

</>复制代码

  1. cd public && php -S 127.0.0.1:3000

访问 http://127.0.0.1:3000/

TinyLara 已经跑起来了!


特性

微型路由包 TinyLara/TinyRoute, 基于性感而快速的 codingbean/macaw

MVC 架构

采用地球上最强大的 PHP ORM 之一:Laravel Eloquent

优雅而强大的 Laravel 式的视图加载器

支持原生 PHP 操作 Redis,无需安装任何 PHP 扩展。

一行代码即可发送 SMTP 邮件。

协议

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


English Version

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

Start Download:

</>复制代码

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

OR:

</>复制代码

  1. wget https://codeload.github.com/TinyLara/TinyLara/legacy.zip/master
  2. unzip master
  3. cd TinyLara*
Install dependencies:

</>复制代码

  1. composer update

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

Just see:

config/routes.php :

</>复制代码

  1. Route::get("", "HomeController@home");

app/controllers/HomeController.php :

</>复制代码

  1. public function home()
  2. {
  3. // mail sample
  4. Mail::to("foo@bar.io")->from("bar@foo.io")
  5. ->title("Foo Bar")
  6. ->content("Hello~~")
  7. ->send();
  8. // redis sample
  9. Redis::set("key","value",3000,"ms");
  10. echo Redis::get("key");
  11. // view sample
  12. return View::make("home")->with("article",Article::first())
  13. ->withTitle("TinyLara :-D")
  14. ->withFooBar("foo_bar");
  15. }
Run:

</>复制代码

  1. cd public && php -S 127.0.0.1:3000

Visit http://127.0.0.1:3000/

It"s already running!


Features

Tiny router TinyLara/TinyRoute, based on fast and sexy codingbean/macaw

MVC architecture

One of the Most powerful PHP ORM on Earth: Laravel Eloquent

Powerful Laravel-style views loader

Redis ready in Laravel-style

Handy SMTP mailer

License

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

文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。

转载请注明本文地址:https://www.ucloud.cn/yun/20874.html

相关文章

  • 量级 PHP 框架 TinyLara 发布

    TinyLara showImg(http://lvwenhan.com/content/uploadfile/201410/dcd81414652600.png); ______ _ __ /_ __/ (_) ____ __ __ / / ____ _ __...

    CarlBenjamin 评论0 收藏0
  • 库&插件&框架&工具

    摘要:一些有用的一些有用的,包括转换小箭头三角形媒体查询等中文指南是当下最热门的前端资源模块化管理和打包工具。 nodejs 入门 nodejs 入门教程,大家可以在 github 上提交错误 2016 年最好用的表单验证库 SMValidator.js 前端表单验证工具分享 浅谈前端线上部署与运维 说到前端部署,可能大多数前端工程师在工作中都是使用的公司现成的部署系统,与SRE对接、一起完...

    Codeing_ls 评论0 收藏0
  • 库&插件&框架&工具

    摘要:一些有用的一些有用的,包括转换小箭头三角形媒体查询等中文指南是当下最热门的前端资源模块化管理和打包工具。 nodejs 入门 nodejs 入门教程,大家可以在 github 上提交错误 2016 年最好用的表单验证库 SMValidator.js 前端表单验证工具分享 浅谈前端线上部署与运维 说到前端部署,可能大多数前端工程师在工作中都是使用的公司现成的部署系统,与SRE对接、一起完...

    xiaowugui666 评论0 收藏0

发表评论

0条评论

最新活动
阅读需要支付1元查看
<