Yii v2 snippet guide III

Comparing #83 with #84

Revision #84 was created by rackycz rackycz on Apr 1, 2021, 10:31:11 PM.

Custom Widgets

Content

[...]
```
And this is basically it. Now we know how to use AdminLTE and fix the GridView. At least one extension will be needed to render widgets, see above.

**Creating custom Widget**
--
See official reading about [Widgets](https://www.yiiframework.com/doc/guide/2.0/en/structure-widgets) or this [explanation](https://www.codevoila.com/post/33/yii2-example-create-yii2-custom-widget-advanced-part). I am presenting [this example](http://www.bsourcecode.com/yiiframework2/how-to-create-custom-widget-in-yii2-0-framework/), but I added 3 rows.

 
 
 Both types of Widgets can be coded like this:

```php
namespace app\components;
use yii\base\Widget;
use yii\helpers\Html;
[...]