intellishop/dwooeight
Composer 安装命令:
composer require intellishop/dwooeight
包简介
Dwoo Eight is a PHP8 compatible fork of the dwoo template engine.
README 文档
README
Dwoo is a PHP5/PHP7 Template Engine that was started in early 2008. The idea came from the fact that Smarty, a well known template engine, is getting older and older. It carries the weight of it's age, having old features that are inconsistent compared to newer ones, being written for PHP4 its Object Oriented aspect doesn't take advantage of PHP5's more advanced features in the area, etc. Hence Dwoo was born, hoping to provide a more up to date and stronger engine.
So far it has proven to be faster than Smarty in many areas, and it provides a compatibility layer to allow developers that have been using Smarty for years to switch their application over to Dwoo progressively.
Dwoo 1.3.x is compatible from PHP 5.3.x to PHP 7.x
Documentation
Dwoo's website to get the latest version is at http://dwoo.org/
The wiki/documentation pages are available at http://dwoo.org/documentation/
Requirements
- PHP >= 5.3
- PHP >= 7.x
- PHP >= 8.0
- Multibyte String
License
Dwoo is released under the GNU LESSER GENERAL PUBLIC LICENSE V3 license.
Quick start - Running Dwoo
Basic Example
<?php // Include Composer autoloader require __DIR__ . '/vendor/autoload.php'; // Create the controller, this is reusable $dwoo = new Dwoo\Core(); // Load a template file (name it as you please), this is reusable // if you want to render multiple times the same template with different data $tpl = new Dwoo\Template\File('path/to/index.tpl'); // Create a data set, if you don't like this you can directly input an // associative array in $dwoo->get() $data = new Dwoo\Data(); // Fill it with some data $data->assign('foo', 'BAR'); $data->assign('bar', 'BAZ'); // Outputs the result ... echo $dwoo->get($tpl, $data); // ... or get it to use it somewhere else $dwoo->get($tpl, $data);
Loop Example
<?php // To loop over multiple articles of a blog for instance, if you have a // template file representing an article, you could do the following : require __DIR__ . '/vendor/autoload.php'; $dwoo = new Dwoo\Core(); $tpl = new Dwoo\Template\File('path/to/article.tpl'); $pageContent = ''; $articles = array(); // Loop over articles that have been retrieved from the DB foreach($articles as $article) { // Either associate variables one by one $data = new Dwoo\Data(); $data->assign('title', $article['title']); $data->assign('content', $article['content']); $pageContent .= $dwoo->get($tpl, $data); // Or use the article directly (which is a lot easier in this case) $pageContent .= $dwoo->get($tpl, $article); }
intellishop/dwooeight 适用场景与选型建议
intellishop/dwooeight 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.02k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 10 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 intellishop/dwooeight 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 intellishop/dwooeight 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 7.02k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0-only
- 更新时间: 2022-10-18