Proposed new feature or change
Based on yiisoft/yii-widgets#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.
Proposed new feature or change
Based on yiisoft/yii-widgets#147
Adds
pipe(callable $callback)widgets via trait or directly toWidgetclass. Passes the widget through the callback and returns the result, keeping the fluent chain intact.Reusable configuration (themes, style presets) can be extracted into callables and composed without subclassing.