Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`pipe()` method

Open
#116 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
php
Domain
frontend

Research direction

Start by locating the Widget class and its existing fluent methods, then review how widget configuration and rendering are tested. Implementing this feature is complete when a callable receives the widget, its result is returned, and the demonstrated fluent chain can still reach render().

Written by the indexing model from the issue text.

Description

status:under discussion
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.

Dominant language
PHP
Stars
25
Forks
5
Avg merge
46m
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from yiisoft/widget

All issues in yiisoft/widget

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.