wplibs/view

Simple template engine with twig support for WordPress

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

This package is auto-updated.

Last update: 2024-10-21 20:26:16 UTC


README

Installation

composer require wplibs/view

Usage

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