Local Extensions

I was working on an extension, but I couldn’t figure out where to place it and how to access it if its not using composer.

So I created a github repository and added the package to composer. The extension was rather small so it didn’t really matter as the development time was only a couple hours. But its an ugly solution for bigger projects.

Can I get some information on where to place the extension, and configuration needed so Yii2 can find it so I can access it by its namespace?


ps. The extension was a widget. No special config required there.

Image taken from Github link provided by Samdark.

Assuming these are the proper settings for local extension. Will test later today and report back with extra info where needed.

@Phim: I’ve updated this part, here’s a link to the source. Please let me know if anything needs clarification or could be improved.

How can I add/activate your gii generator in my existing (advanced) application?

I expected your generator in "/advanced/vendor/yiisoft/yii2-gii/generators".

Thanks, but it’s not merged yet … but you can get it like so:



You can add my fork as a composer repo to your composer.json, this will override the info for yiisoft/yii2-dev from packagist.org




            "type": "git",

            "url": "https://github.com/schmunk42/yii2"



[/size][size="2"]then require the desired branch:[/size][size="2"]


    "yiisoft/yii2-dev": "dev-feature/gii-extension-generator",


[/size][size="2"]And run [/size] [size="2"]

composer.phar update


You can apply this workflow to any package, where you have to include a custom revision.


Add my repo as another remote for yii2-dev https://github.com/schmunk42/yii2 in vendor/yiisoft and checkout the feature/gii-extension-generator branch.[/size]

Gii extension generator has been merged as of 26/02/2014. Thanks!

A simple ‘composer update’ will do the trick now.

Please submit any issues found and suggestions to github.

follow up: https://github.com/yiisoft/yii2/issues/2555