Novice issues with the yii2 basic template

I came with this issues while using the yii2 basic template.

  • For some reason I deleted /web/assets/ contents, so my app visually broke since some js and css were gone. I had no idea how get those files back, nor what or when exactly created them since they aren’t in the basic template as downloaded. I had to download latest (2.0.9) template from http://www.yiiframework.com/download/ and copy the directories ‘config, controllers, models, views, web’ over from my 2.0.8 folder. Somehow they were back. How is so? Actually this is also how I have updated the template version in the past, is it safe?

  • The basic template on the github repository is not the same as the one you download at http://www.yiiframework.com/download/. Why is that? I get


# composer vendor dir

/vendor

but as a novice, I wasn’t expecting it.

There’s no templates updating. Once you’ve started your own project, all these files are yours. Of course, you can take fresh template but it’s up to you what to update.

web/assets are generated automatically by asset manager if they aren’t there. vendor directory is normally created by composer tool. If you’re downloading zip from website, it includes vendor dir archived after running composer.