pjpawel/magis

PHP 模板引擎

v0.2.0 2022-12-22 23:13 UTC

This package is auto-updated.

Last update: 2024-09-29 06:03:25 UTC


README

用于PHP模板渲染的symfony包服务

Latest Version on Packagist Scrutinizer Code Quality PHPStanLevel

为什么选择Magis?

- 它非常快!

- 它很容易理解!

- 它可以实现您所需的所有服务!

安装

如果您想将Magis作为symfony包安装,您应该使用 MagisBundle

composer require pjpawel/magis-bundle

如果您想使用原始视图服务和视图类,请使用(此存储库)

composer require pjpawel/magis

库类

\pjpawel\Magis\ViewDispatcherService::class // service to dependency injection
\pjpawel\Magis\View\DirectView::class // simple view class that has method render() to ... render template :)
\pjpawel\Magis\View\MagicView::class // rich view class

用法

您应该使用 ViewDispatcherService 作为依赖注入服务。您可以创建自定义服务来渲染视图或直接使用创建的视图。