xmeltrut/wing-commander
Composer 安装命令:
composer require xmeltrut/wing-commander
包简介
Mustache template library wrapper for the Flight microframework
README 文档
README
Wing Commander is a Mustache wrapper for the Flight PHP microframework.
Installation
The easiest way to install Wing Commander is using Composer. Create a composer.json file in the root of your project and require Wing Commander.
{
"require": {
"xmeltrut/wing-commander": "*"
}
}
Then run the install command, and this will install all dependencies - including Flight and Mustache.
composer install
Usage
A basic usage would look like the following.
require 'vendor/autoload.php';
WingCommander::init();
Flight::route('/', function(){
Flight::view()->set("someVar", "Hello, World!");
Flight::render("homepage", array(), "body");
Flight::render("layout", array("title" => $pageTitle));
});
Flight::start();
By default, it will look for Mustache templates in the ./templates directory of your project. You can change this by calling the setTemplatePath method.
Flight::view()->setTemplatePath("./application/templates");
Lets create homepage.mustache.
<p>{{someVar}}</p>
A layout to wrap it in too - layout.mustache.
<p>Wing Commander says:</p>
{{{body}}}
Bringing it all together, you can use it like you would use the standard Flight view component.
Flight::view()->set("someVar", "Hello, World!");
Flight::render("homepage", array(), "body");
Flight::render("layout", array("title" => $pageTitle));
Further Reading
xmeltrut/wing-commander 适用场景与选型建议
xmeltrut/wing-commander 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 603 次下载、GitHub Stars 达 8, 最近一次更新时间为 2012 年 11 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「microframework」 「mustache」 「flight」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 xmeltrut/wing-commander 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 xmeltrut/wing-commander 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 xmeltrut/wing-commander 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This Bundle provides a wrapper for the FlightStats API
Strongly opinionated MVC framework for rapid development
A lightweight, secure-by-default PHP microframework built on Slim – providing Laravel-like features (ORM, authentication, migrations, caching) without the bloat. Perfect for building REST APIs and small-to-medium PHP applications.
Tidy session library for Flight PHP
An extremely fast PHP implementation of handlebars ( http://handlebarsjs.com/ ) and mustache ( http://mustache.github.io/ ). This package forked from Zordius/LightnCandy.
docx template manipulation class, based on mustache templating language
统计信息
- 总下载量: 603
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 22
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2012-11-13