# codemonster-razor **Repository Path**: wfdaj/codemonster-razor ## Basic Information - **Project Name**: codemonster-razor - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-12-12 - **Last Updated**: 2025-12-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # codemonster-ru/razor [![Latest Version on Packagist](https://img.shields.io/packagist/v/codemonster-ru/razor.svg?style=flat-square)](https://packagist.org/packages/codemonster-ru/razor) [![Total Downloads](https://img.shields.io/packagist/dt/codemonster-ru/razor.svg?style=flat-square)](https://packagist.org/packages/codemonster-ru/razor) [![License](https://img.shields.io/packagist/l/codemonster-ru/razor.svg?style=flat-square)](https://packagist.org/packages/codemonster-ru/razor) [![Tests](https://github.com/codemonster-ru/razor/actions/workflows/tests.yml/badge.svg)](https://github.com/codemonster-ru/razor/actions/workflows/tests.yml) Template engine for PHP. ## ๐Ÿ“ฆ Installation Via Composer: ```bash composer require codemonster-ru/razor ``` ## ๐Ÿš€ Usage ```php use Codemonster\View\View; use Codemonster\View\Locator\DefaultLocator; use Codemonster\Razor\RazorEngine; $locator = new DefaultLocator([__DIR__ . '/resources/views']); // you can specify an array of paths $engine = new RazorEngine($locator, 'razor.php', __DIR__ . '/storage/cache/views'); $view = new View(['razor' => $engine], 'razor'); echo $view->render('emails.welcome', ['user' => 'Vasya']); ``` ๐Ÿ“„ **resources/views/emails/welcome.razor.php** ```html

Hello, {{ $user }}

@if($user === 'Vasya')

Welcome back!

@endif ``` ## ๐Ÿงช Testing You can run tests with the command: ```bash composer test ``` ## ๐Ÿ‘จโ€๐Ÿ’ป Author [**Kirill Kolesnikov**](https://github.com/KolesnikovKirill) ## ๐Ÿ“œ License [MIT](https://github.com/codemonster-ru/razor/blob/main/LICENSE)