Normally I would use that but the book (Web Application Development with Yii 2 and PHP) is instructing me to build the application from scratch. So I have to build it seperately.
I digged it a little bit more, it seems problem is about the alias of the assets folder.
In GiiAsset.php file, there is this codeblock:
...
class GiiAsset extends AssetBundle
{
public $sourcePath = '@yii/gii/assets';
...
well, I’m just trying to follow the instructions in the mentioned book. It just installs the bare code base and integrate the modules one by one while teaching them. But as long as I install the components via composer, they should behave the same, right?
Oh, by the way, I probably should have mentioned that I am strictly following the conventions and instructions in the book and I did not installed the basic application template. I installed the bare code base with following command:
I think it would be a good time to remove the entry for gii in your composer.json and delete the ‘vendor’ folder and run composer install again.
Then perform a require-dev for the gii module instead.
Gii in production is a very bad idea.
Before you do that, you should clean the composer cache and maybe - and I recommend that you do that - create a standard Yii application using the ‘basic’ Yii2 composer template.
If that works/fails, then you’d be wiser.
You also need to clean up whatever configuration changes you made in your quest to make Gii work.
(I installed the bare code base, not basic app template - in order to reproduce the error)
I still get this error:
When I rename the vendor/bower-asset folder to vendor/bower, all works great.
Later on I also installed the basic application template, it works without a glitch, but bower folder there named as bower instead of bower-asset, by default.
In this point I have a couple of questions:
Is this behavior for bare code base expected?
Would I break anything if I manually rename the bower-asset folder to bower? (So far all looks good)
I know that best thing to do is installing the basic app template, but in order to follow the book, I need the bare code base, as it is teaching things by building things and adding them up one by one.
If I understand right, this section instructs the composer to install the related asset folders to specified paths (e.g. npm-asset to npm and bower-asset to bower). Is that correct?
Is there any manual or resource that I can read more about this?