wplibs / view
支持twig的简单模板引擎,适用于WordPress
dev-master
2018-11-20 17:19 UTC
Requires
- php: >=5.5.0
Requires (Dev)
- mockery/mockery: ^0.9|^1.0
- phpunit/phpunit: 4.8.*|5.7.*
- twig/twig: ^1.0
This package is auto-updated.
Last update: 2024-09-21 20:18:05 UTC
README
安装
composer require wplibs/view
使用
<?php use WPLibs\View\Factory; $view_factory = Factory::create([ 'paths' => [ get_stylesheet_directory() . '/custom-templates', get_template_directory() . '/custom-templates', '/path-to-plugin-dir/templates', ] ]); echo $view_factory->make('welcome.php', ['data' => 'value']);