承接 shapecode/twig-string-loader 相关项目开发

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

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

shapecode/twig-string-loader

最新稳定版本:2.0.0

Composer 安装命令:

composer require shapecode/twig-string-loader

包简介

A string loader for twig

README 文档

README

paypal

PHP Version Latest Stable Version Latest Unstable Version Total Downloads Monthly Downloads Daily Downloads License

Install instructions

First you need to add shapecode/twig-string-loader to composer.json:

Do it by execute composer require shapecode/twig-string-loader or do it manually

{
   "require": {
        "shapecode/twig-string-loader": "^1.0"
    }
}

Add the string loader to your $twig object

<?php

// index.php
//...

$loader1 = new \Twig\Loader\FilesystemLoader('/path/to/templates');
$loader2 = new \Shapecode\Twig\Loader\StringLoader();
$loader = new \Twig\Loader\ChainLoader([$loader1, $loader2]);

$twig = new \Twig\Environment($loader);

Usage

Now you can compile strings with twig:

<?php

$twig->render('Hello {{ world }}', array(
    'world' => 'World'
));

统计信息

  • 总下载量: 118.97k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-07-03