You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
return $b->addClass('red'); is not HTML, but object.
Not sure yet if this will be good or bad. Why self-replacing is something different than doing any other action on other views trough hooks?
$b = new Button();
$f = new Form();
$app->add($b);
$app->add($f);
$b->onClick(function($b) use ($f) {
$b->addClass('red')->set('Thanks for clicking'); // change button
$f->destroy(); // no more form at all
});
but, yeah, i guess you're right - we probably need to return HTML code (or renderable object) and that could replace object on which hook is called. In this case - button. Otherwise we have to use JS chain to make some changes in layout.
When button is clicked it should replace itself with new provided HTML.
The text was updated successfully, but these errors were encountered: