Yii Framework Forum: Yii 1 module inside yii 2 application - Yii Framework Forum

Jump to content

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

Yii 1 module inside yii 2 application

#1 User is offline   EPM 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 31-August 15

Posted 09 November 2015 - 04:31 PM

Hey all,

I have a Yii 1 application with 5 modules and we want to start building new applications/modules using Yii 2. Migrating the existing Yii 1 application and modules to Yii 2 is not an option, it will takes time. But we want to start new modules/applications using Yii 2.

The Yii 1 application has a layout and a security module with some controllers/models and filters for doing authentication and authorization. The new Yii 2 application will be doing a SSO (using the cookie approach) with the Yii 1 application.

However, the issue I have right now is, how to deal with the security module. I don't want to duplicate that code generating it in Yii 2, specially the model classes that map to my security database schema. What options do I have? Can I somehow reuse the security Yii 1 module in the Yii 2 application ?

Thanks for your advise.
0

#2 User is offline   MetaCrawler 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 390
  • Joined: 12-February 11
  • Location:Germany

Posted 11 November 2015 - 02:48 AM

Hi,

Have you seen this already?

Maybe worth a try in your situation:
http://www.yiiframew...ii-2-with-yii-1

If that does not work I have no good suggests, sorry.

Best Regards
0

#3 User is offline   hippyjim 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 28-December 11

Posted 18 May 2017 - 03:33 AM

Did you get anywhere with this?

I've got a Yii 1 application with 19 modules in it. I started development on it a year before Yii 2 was finally released. It became obsolete before it was even really established.

I want to start moving to Yii 2 (before Yii 1 becomes unsafe) so was looking at the advice that says add new features using Yii 2, inside your Yii 1 app. The only problem is, it just mentions how to load Yii 2 classes, and nothing else. How do you handle routing? Authentication? Relations between existing Yii 1 models and Yii 2 ones? Configuration? Anything other than loading a few models?

It still looks like I'd have to rebuild half my application from scratch just to make a single Yii 2 module.

Anyone got any examples?
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