yii2-bootstrap5
yii2-bootstrap5 copied to clipboard
Added view option to render a view with Yii inside tab content
| Q | A |
|---|---|
| Is bugfix? | ❌ |
| New feature? | ✔️ |
| Breaks BC? | ❌ |
| Fixed issues |
Adds the posibility to render a view inside a Tab content.
echo Tabs::widget([
'items' =>[
[
'label' => 'Tab label',
'view' => ['@app/views/site/my-view',['param1'=>'value1']],
'visible' => true,
],
],
]);
The main benefit is that when used with visible = false it won't render the view.
is this really necessary? possible to do with
echo Tabs::widget([
'items' =>[
[
'label' => 'Tab label',
'content' => $this->render('@app/views/site/my-view', ['param1'=>'value1']),
'visible' => true
]
]
]);
inside view, isn't it?
Hi, the difference is that when using
echo Tabs::widget([
'items' =>[
[
'label' => 'Tab label',
'content' => $this->render('@app/views/site/my-view', ['param1'=>'value1']),
'visible' => false
]
]
]);
The view will be rendered, even though visible is set to false.
Ok so it would be some performance boots by preventing the rendering inside widget when visible false, correct?
Not only performance, also to avoid code conflicts (some developer might put some JS in the view that overrides the JS in another view)