Revision #3 was created by jwerner on Mar 19, 2019, 11:55:33 AM.
Fixed some code formatting
Yii version
2.0
Tags
yii2, How to, Egoogle,extension, Ggithub, Packagist, Composer, hzl, composer,yii2,Hzl,Packagist,scotthuangzl, google
Content
**1. Create Extension in yii2.**
As for this step, you can refer to [Create Extension](https://github.com/yiisoft/yii2/blob/master/docs/guide/structure-extensions.md "create extension")
In short, you can use gii to create extension after read above article. Just be care to change the output as
```php
@app/vendor/yourname
```
change the namespace as
```php
yourname\yourwidgetname\
```
It will need input your github account and pass since use -u.
In future, you only need below
```bash
$ git push origin master
~~~```
**4. Register your github repository into packagist**
Don't forget register your github repository into packagist, end user can install your widget only after you complete register.
And packagist will give you hint for how to setup service in github to auto synchronize every commit from github to packagist.