I want to install Yii2 in the root of an Opencart installation as I would like to make certain core Yii framework files available to Opencart. I would also like to have a functioning Yii2 advanced application within the Opencart root directory.
Take a look at the BASIC Yii 2 application template, and modify the composer.json in your OpenCart installation, adding the Yii 2 composer packages to it.
When you’ve installed Yii 2 into your OpenCart installation, and it works, then you are ready to create a Yii 2 application in your OpenCart dir.
I think you should do this manually.
And I also think that you need to forget about the advanced template.
Do you really need two separate Yii 2 applications in your OpenCart application?
I was thinking about having a bit of fun by trying to replicate some of the Opencart functionality in Yii2 as both a frontend and admin side. So I was hoping to have both the Opencart and Yii advanced apps working so I can work with both in PHPStorm at the same time.
So I have now installed the yiibasic app in the root of the Opencart project. I installed it from the command line. So now the only instance of the Yii framework I have is in the yiibasic>vendor folder. I would ideally have this available in the main vendor folder in the Opencart project root but I can’t get it to install via composer.json.
How do I make the Yii framework classes available to PHPStorm and the Opencart app? Do I need to call the autoloader in the yiibasic root?
I’ve managed to get the Yii2 framework to install after trying (and failing) maybe a dozen times today. Odd. Anyway, it’s done now. A restart of PHPStorm and it’s showing in the intellisense now. Hurrah!
Re: just using a module for admin. I think you may be right. Right now I am just trying to replicate a the admin console of Opencart. If I can do that, I might go for some additional functionality such as a CMS too. I dont think that is too ambitious, although it will be time-consuming. If I can get that done, I am thinking about setting up the Yii admin module as a REST application and API with an frontend built in React.
I am currently developing a site using the advanced app. The admin (backend) is a very different app from the frontend, so I wanted a total separation of concerns as it uses a different layout etc. You think there are really no advantages to this and I should just use a module instead?