I’m new to Yii - I’ve installed the basic application template (archive) without any issues.
I now want to make the framework available for multiple applications, so that the framework does not have to be installed for each app.
I’ve looked at the advanced application template, but I think I’m correct in saying that it’s more for a project that shares the same code base (frontend/backend)?
The structure I had in mind was the following:
[indent]/vendor[/indent]
[indent]/Apps/TestApp1[/indent]
[indent][indent]/Apps/TestApp1/assets[/indent][/indent]
[indent][indent]/Apps/TestApp1/commands[/indent][/indent]
[indent][indent]/Apps/TestApp1/config[/indent][/indent]
[indent][indent]/Apps/TestApp1/controllers[/indent][/indent]
[indent][indent]/Apps/TestApp1/mail[/indent][/indent]
[indent][indent]/Apps/TestApp1/models[/indent][/indent]
[indent][indent]/Apps/TestApp1/runtime[/indent][/indent]
[indent][indent]/Apps/TestApp1/tests[/indent][/indent]
[indent][indent]/Apps/TestApp1/views[/indent][/indent]
[indent][indent]/Apps/TestApp1/web[/indent][/indent]
[indent]/Apps/TestApp2[/indent]
[indent][indent]/Apps/TestApp2/assets[/indent][/indent]
[indent][indent]/Apps/TestApp2/commands[/indent][/indent]
[indent][indent]/Apps/TestApp2/config[/indent][/indent]
[indent][indent]/Apps/TestApp2/controllers[/indent][/indent]
[indent][indent]/Apps/TestApp2/mail[/indent][/indent]
[indent][indent]/Apps/TestApp2/models[/indent][/indent]
[indent][indent]/Apps/TestApp2/runtime[/indent][/indent]
[indent][indent]/Apps/TestApp2/tests[/indent][/indent]
[indent][indent]/Apps/TestApp2/views[/indent][/indent]
[indent][indent]/Apps/TestApp2/web[/indent][/indent]
The index.php in each application has been amended from:
require(__DIR__ . '/../vendor/autoload.php');
require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php');
To:
require(__DIR__ . '/../../../vendor/autoload.php');
require(__DIR__ . '/../../../vendor/yiisoft/yii2/Yii.php');
This does not work, I am getting multiple errors with the first being:
The file or directory to be published does not exist: C:\wamp\Apps\TestApp1\vendor\bower/jquery/dist
Could you point me in the correct direction on how to achieve this?
Many Thanks