Streng Behavior From Composer

Guys,

I updated project using composer --prefer-dist update command.

After that I faced an error on project:




Call to undefined method yii\helpers\Html::csrfMetaTags()



I saw yii\helpers\BaseHtml and there is no such function.Then I check github and there is.

clearing composer cache not affect.

What’s going on? is it packagist?

You have to install the composer asset plugin.


php composer.phar global require "fxp/composer-asset-plugin:1.0.*@dev"

See here why: http://stackoverflow.com/questions/25884038/yii2-error-yii-base-unknownmethodexception-calling-unknown-method-yii-web-url/25899040#25899040

I had trouble with this as well. I ran composer and it ate my yiisoft folder, among other things. I found this thread and did a self-update on composer and then installed the [color=#008800][size=2]"fxp/composer-asset-plugin:1.0.*@dev" [/size][/color][size=2]plugin. It did an update. It installed a folder named bower-assets, however the application was choking, looking for a location named bower, so I simply renamed the folder to bower in the vendor directory and it seems to work.[/size]

[size=2]

[/size]

[size=2]I don’t know anything about bower. I don’t know how this changes things. I will be checking the guide and looking for any and all instructions in this forum.[/size]

Can I use yii2 without the composer-asset-plugin?