Yii Framework Forum: Combining MVC Concept with Conventional Coding Style - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Combining MVC Concept with Conventional Coding Style Rate Topic: -----

#1 User is offline   viktor 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 21-April 10

Posted 23 April 2010 - 04:46 AM

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 ?
-1

#2 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,879
  • Joined: 04-October 08
  • Location:DC, USA

Posted 23 April 2010 - 05:24 AM

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.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users