Combining MVC Concept with Conventional Coding Style

Hello, since all YII framework run under index.php

is there possible way to use Conventional Coding Style to mix with YII ?

i ask this because we already invest in a commercial module that ‘upgrade’ our dreamweaver to become a great shopping cart software… but all the code is not using MVC at all… any idea to join/mix-up the technology ?

Yes, you can. To do so, you just need to insert the following code in your modules:




require_once(path/to/yii.php);

Yii::createWebApplication($config);



Then, you can access all available resources defined in your normal MVC part of the application via Yii::app().

Note that we don’t call “run()” in the above because it would otherwise go through the normal MVC workflow.