`pipe()` method
还没有人认领这个 Issue。
评估
调研方向
首先定位 Widget 类及其现有的 fluent 方法,然后检查 widget 配置和渲染的测试方式。实现此功能的完成标准是:callable 接收 widget、返回其结果,并且演示的 fluent 链仍然可以到达 render()。
由索引模型根据 Issue 内容生成。
描述
Proposed new feature or change
Based on https://github.com/yiisoft/yii-widgets/pull/147
Adds pipe(callable $callback) widgets via trait or directly to Widget class. Passes the widget through the callback and returns the result, keeping the fluent chain intact.
$tailwindNav = fn(Menu $m) => $m->class('flex space-x-4')->linkClass('px-3 py-2 rounded-md');
Menu::widget()
->items($items)
->pipe($tailwindNav)
->render();
Reusable configuration (themes, style presets) can be extracted into callables and composed without subclassing.
- 主要语言
- PHP
- 星标
- 25
- 派生
- 5
- 平均合并
- 46 分钟
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
yiisoft/widget 的其他 Issue
-
难度 5/5 一周以上 新手友好度 35/100
-
type:docs
难度 2/5 1-3 小时 新手友好度 25/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
Automattic/static-site-importer#1879 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
521xueweihan/HelloGitHub#3790 ·
-
Bug (unconfirmed) Good first issue 1️⃣ help wanted UI :art:
难度 2/5 1-3 小时 新手友好度 70/100
FreshRSS/FreshRSS#9360 · 2 条评论 ·
维护者通常 1 天内回复