shapecode/twig-string-loader-bundle 问题修复 & 功能扩展

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

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

shapecode/twig-string-loader-bundle

最新稳定版本:4.0.0

Composer 安装命令:

composer require shapecode/twig-string-loader-bundle

包简介

Adds a string loader to 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-bundle to composer.json:

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

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

You also have to add ShapecodeTwigStringLoaderBundle to your AppKernel.php ...

<?php

// app/AppKernel.php
//...

class AppKernel extends Kernel
{
    //...
    public function registerBundles()
    {
        $bundles = array(
            ...
            new Shapecode\Bundle\TwigStringLoaderBundle\ShapecodeTwigStringLoaderBundle(),
        );
        //...

        return $bundles;
    }
    //...
}

... or bundles.php when you don't use Symfony Flex.

<?php

// bundles.php
//...

return [
    // .....  
    Shapecode\Bundle\TwigStringLoaderBundle\ShapecodeTwigStringLoaderBundle::class => ['all' => true],
];

Usage

Now you can compile strings with twig:

<?php

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-01-10