codemonster-ru / view-php
PHP template engine for codemonster-ru/view
v2.0.0
2025-09-28 09:26 UTC
Requires
- php: >=8.2
- codemonster-ru/view: ^2.0
Requires (Dev)
- phpunit/phpunit: ^9.6 || ^10.5 || ^11.0 || ^12.0
README
PHP template engine for the codemonster-ru/view
core.
Uses the core Locator for consistent file resolution (dot-notation, namespaces, multiple base paths).
๐ฆ Installation
Via Composer:
composer require codemonster-ru/view-php
๐ Usage
use Codemonster\View\View; use Codemonster\View\Locator\DefaultLocator; use Codemonster\View\Engines\PhpEngine; $locator = new DefaultLocator([__DIR__ . '/resources/views']); // can be an array $engine = new PhpEngine($locator, 'php'); // or ['phtml','php'] $view = new View(['php' => $engine], 'php'); echo $view->render('emails.welcome', ['user' => 'Vasya']);
๐งช Testing
You can run tests with the command:
composer test