定制 vintagesucks/twig-renderer 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

vintagesucks/twig-renderer

最新稳定版本:v3.0.2

Composer 安装命令:

composer require vintagesucks/twig-renderer

包简介

Twig 3.x for Yii 1.x

README 文档

README

Build Status Dependabot Packagist Packagist

This extension allows you to use Twig 3.x templates in Yii 1

Requirements

  • Yii 1.1 or above
  • PHP 7.2 or above

Installing

  • Install via Composer:
composer require vintagesucks/twig-renderer
  • Add the following to your config file 'components' section:
'viewRenderer' => [
    'class' => 'root.vendor.vintagesucks.twig-renderer.ETwigViewRenderer',
    'twigPathAlias' => 'root.vendor.twig.twig.lib.Twig',
    'fileExtension' => '.twig',
],

Usage

  • See Twig syntax
  • Current controller properties are accessible via {{ this.pageTitle }}
  • Yii::app() object is accessible via {{ App }} (Example: {{ App.name }})
  • Yii's core static classes (CHtml, for example) are accessible via {{ C.ClassNameWithoutFirstC.Method }} (Example: {{ C.Html.textField(name,'value') }})
  • To call functions or methods which return non-string results wrap these calls in a void function: {{ void(App.clientScript.registerScriptFile(...)) }}

Development

Run test matrix locally with act:

act --job build \
  --workflows .github/workflows/build.yml \
  --platform ubuntu-latest=shivammathur/node:latest \
  --container-architecture linux/amd64

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固