New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust widgets to support immutability #22
Conversation
terabytesoftw
commented
Nov 29, 2020
Q | A |
---|---|
Is bugfix? | ✔️ |
New feature? | ❌ |
Breaks BC? | ❌ |
Fixed issues | yiisoft/yii-bulma#20 |
We have two types of widgets: Widget simple: $widget = MyWidget::widget();
$widget->render(); Widget begin/end: $widget = MyWidget::begin();
$widget->start();
// content
$widget->end(); |
Another variant but there will be a great BC: We have two types of widgets: Widget simple: $widget = MyWidget::widget()->options(['class' => 'testMe']);
$widget->render(); Widget begin/end: $widget = MyWidget::widget()->options(['class' => 'testMe']);
$widget->begin();
// content
$widget->end(); or MyWidget::widget()->options(['class' => 'testMe'])->begin();
// content
MyWidget::end(); |
Do you mean: $widget = MyWidget::widget()->option1(true)->option2(false);
$widget->begin();
// content
$widget->end(); ? |
yes. |
In a template that would be: <?php $widget = MyWidget::widget()->option1(true)->option2(false) ?>
<?= $widget->begin() ?>
Content
<?= $widget->end() ?> It could also be: <?= MyWidget::widget()->options(['class' => 'testMe'])->begin() ?>
// content
<?= MyWidget::end() ?> |
yes, i have added the test. |
@samdark Please check I think all the PRs that BC will do in the repositories are ready, are there any missing ? |
I'll fix these. |