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

v2.1.0 2025-10-14 14:22 UTC

This package is auto-updated.

Last update: 2025-10-17 14:07:58 UTC


README

Latest Version on Packagist Total Downloads License Tests

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

๐Ÿ‘จโ€๐Ÿ’ป Author

Kirill Kolesnikov

๐Ÿ“œ License

MIT