承接 danack/jig 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

danack/jig

最新稳定版本:0.21.2

Composer 安装命令:

composer require danack/jig

包简介

Lightweight, fast, flexible PHP templating system that uses real dependency injection.

README 文档

README

Jig - "A device that holds a piece of machine work and guides the tools operating on it."

Or to put it another way, a jig allows you to work fast with sharp tools without cutting your fingers off.

Build status
Latest Stable Version

What

Jig is a template renderer that promotes the view layer to be a first class citizen in your application.

By using it, all of your templates are unit-testable as it does not use the 'service locator' pattern like most other templating systems do.

  • Compiles to PHP class for super-duper performance.

  • Uses real Dependency injection in templates, to allow unit testing of views.

  • Super lightweight. Zero overhead when templates are already compiled when used with APC/OPCache

  • Simple but powerful plugin system.

Documentation

Please run this to view the documentation:

git clone https://github.com/danack/TierJigDocs
cd TierJigDocs/
composer install
mkdir -p var/cache
php -S localhost:8000 -t public

The "I know what I'm doing" just show me some code" guide to using Jig

use Auryn\Injector;
use Jig\JigConfig;
use Jig\Jig;

// Create a JigConfig object
$jigConfig = new JigConfig(
    //The directory the source templates are in
    __DIR__."/../templates/",
    //The directory the generated PHP code will be written to.
    __DIR__."/../var/generatedTemplates/",
    // How to check if the templates need compiling.
    Jig::COMPILE_CHECK_MTIME,
    // The extension our templates will have.
    "php.tpl"
);

// Create a Jig renderer with our config
$jig = new Jig($jigConfig);

// Check the template is compiled to PHP and get the classname of the
// generated PHP template.
$className = $jig->compile("gettingStarted/basic");

// Create a DIC that can create an instance of the template
$injector = new Injector();

$injector->alias('Jig\Escaper', 'Jig\Bridge\ZendEscaperBridge');

// Create an instance of the template
$templateInstance = $injector->make($className);

// Render the template and send it to the user.
$output = $templateInstance->render();

// Send the output to the user
echo $output;

// Alternatively if your DIC supports direct execution 
//$output = $injector->execute([$className, 'render']);

danack/jig 适用场景与选型建议

danack/jig 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 810 次下载、GitHub Stars 达 6, 最近一次更新时间为 2015 年 02 月 26 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「template」 「library」 「view」 「jig」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 danack/jig 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 danack/jig 我们能提供哪些服务?
定制开发 / 二次开发

基于 danack/jig 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 810
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 18
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 3
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-26