承接 effectra/renova 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

effectra/renova

最新稳定版本:v1.0.2

Composer 安装命令:

composer require effectra/renova

包简介

Effectra Renova is a PHP package that provides a template rendering and web asset management functionality. It includes a template engine for rendering template files and a web asset management system for generating script and link tags for web assets.

README 文档

README

Effectra\Renova is a PHP package that provides a template rendering and web asset management functionality. It includes a template engine for rendering template files and a web asset management system for generating script and link tags for web assets.

Installation

You can install the Effectra\Renova package via Composer. Simply run the following command:

composer require effectra/renova

Usage

Template Engine

The template engine allows you to render template files using a template syntax. Here's an example of how to use the template engine:

use Effectra\Renova\TemplateEngine;

$template = new TemplateEngine();

// Render a template file
$content = (new Render(
    $path,
    $data,
    [
        ['url' => function ($path = '') {
                return Request::url() . (string) $path;
            }]
    ],
    [
        ['APP_NAME' => $_ENV['APP_NAME'] ]
    ],
    $this->reader
))->send();

$links = $this->encore->linkTags('app');
$scripts = $this->encore->scriptTags('app');

$content = $this->addLinksAndScripts($content, $links, $scripts);

In the example above, we create a new instance of the TemplateEngine class indirectly by instantiating the Render class. The Render class uses the TemplateEngine internally for rendering the template file. We pass the necessary arguments to the Render constructor, including the template file path, data, template functions, template global variables, and an instance of the Reader class.

Web Asset Management

The web asset management feature allows you to generate script and link tags for web assets managed by Encore. Here's an example of how to use the web asset management:

use Effectra\Renova\WebEncore;

$webEncore = new WebEncore();

// Generate script tags for a specific section
$scriptTags = $webEncore->scriptTags('app');

// Generate link tags for a specific section
$linkTags = $webEncore->linkTags('styles');

In the example above, we create a new instance of the WebEncore class. We then use the scriptTags and linkTags methods to generate the script and link tags for the specified sections.

Contributing

Thank you for considering contributing to the Effectra\Renova package! If you would like to contribute, please follow the guidelines in the CONTRIBUTING.md file.

License

The Effectra\Renova package is open-source software licensed under the MIT license.

统计信息

  • 总下载量: 30
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-19