daily-five/plates-service-provider

为 daily-five 框架提供 Plates 模板引擎

安装: 28

依赖者: 0

建议者: 0

安全: 0

星标: 0

分支: 0

类型:提供者

v1.1.1 2019-05-03 21:22 UTC

This package is auto-updated.

Last update: 2024-09-12 21:08:21 UTC


README

本项目旨在将 Plates 模板引擎集成到 daily-five 框架

目录

安装

通过 CLI 安装...

composer require daily-five/plates-components

...或添加到 composer.json 中

{
    "require": {
        "daily-five/plates-service-provider": "^1.0"
    }
}

如果安装时遇到权限问题,请尝试此 解决方案

用法

在您的应用程序中启用它

<?php

/** @var \DailyFive\Application|\Pimple\Container $app */
$app->register(new \DailyFive\Provider\PlatesServiceProvider(), [
    
    // add folders (optional)
    'plates.folders' => [
        'name' => 'path',
    ],
    
    // add shared data (optional)
    'plates.data.shared' => [
        'msg' => 'Hello World!',
    ],
    
    // add extensions (optional)
    'plates.extensions' => [
        
    ],
]);

echo $app['template_engine']->render('hello-world', array()); 

许可证

Plates Service Provider 使用 MIT 许可证授权。