codemonster-ru / view-php
PHP template engine for codemonster-ru/view
Installs: 46
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/codemonster-ru/view-php
Requires
- php: >=8.2
- codemonster-ru/view: ^2.0
Requires (Dev)
- phpunit/phpunit: ^9.6 || ^10.5 || ^11.0 || ^12.0
This package is auto-updated.
Last update: 2025-10-17 14:07:58 UTC
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