effectra/renova
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.
effectra/renova 适用场景与选型建议
effectra/renova 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 30 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 06 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 effectra/renova 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 effectra/renova 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 30
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 18
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-06-19