Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mlt7y's avatar
Level 1

Extending Vendor Component (Wire-UI)

So I'm trying to add a feature to Wire-UI components (a tooltip option). I've published the config file and I am pointing the input component to a new class which extends the Wire-UI class (https://github.com/wireui/wireui/blob/main/src/View/Components/Input.php)

class MyInput extends Input {
     public ?string $tooltip;
     public function __construct(?string $tooltip = null, ... $params) {
        parent::__construct(... $params);
        $this->tooltip = $tooltip;
    }
    protected function getView(): string
    {
        return 'components.input';
    }
}

I've pointed it to a new component blade file which uses all the original variables set in the constructor (e.g., label, prefix, etc.)

With the above, only the $tooltip (and nonspecific variables like $name) work. If I remove the construct completely, it works as it should (but of course, I can then not set my $tooltip variable).

Any reason why passing the $params to the parent::__construct() is not working to properly pass the parent parameters?

0 likes
0 replies

Please or to participate in this conversation.