wplibs/view

支持twig的简单模板引擎,适用于WordPress

dev-master 2018-11-20 17:19 UTC

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']);