frizzy/slim-view 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

frizzy/slim-view

Composer 安装命令:

composer require frizzy/slim-view

包简介

Extends the Slim Framework View class for easy injection of any templating engine

README 文档

README

Inject any rendering engine into your Slim View. Multiple engines are supported and the view will fall back to standard PHP templates if a template cannot be resolved.

Usage

Add the following in your root composer.json file:

{
    "require": {
        "frizzy/slim-view": "0.*"
    }
}

Adding Twig to your view:

$view   = new \Frizzy\Slim\View\View;
$loader = new \Twig_Loader_Filesystem(__DIR__ . '/my_templates'); 

$view->setRenderEngine(
    new \Twig_Environment($loader),
    function ($engine, $template, $data) {        
        return $engine->loadTemplate($template)->render($data); 
    },
    function ($template) {
        return preg_match('/\.twig$/', $template);
    }
);

统计信息

  • 总下载量: 34
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-11-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固