Answers.Body: <blockquote>
    <p>Is there an easy way to create Craft plugins that will call my existing Yii controllers?</p>
  </blockquote>
  
  <p>There might be a way, but I'm not sure how easy it'd be.</p>
  
  <p>I think it'd be a more guaranteed easy path if you were to take your existing Yii controllers and turn them into Craft plugin <a href="http://buildwithcraft.com/docs/plugins/controllers" rel="nofollow">controllers</a>, but I'm not sure of the extent and complexity of your existing application.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-28T02:27:54.133Z
Answers.LastActivityDate: 2015-06-27T05:08:43.607Z
Answers.LastEditDate: 2015-06-27T05:08:43.607Z
Answers.UserDisplayName: Brad Bell
Answers.Body: <p>I don't think there is going to be an easy one-to-one mapping for migrating a Yii site to Craft. There may be several areas you can reuse code, but I expect you'll need to restructure things a bit to fit the Craft plugin architecture.</p>
  
  <p>You also mention a handful of static pages. It sounds like these pages are not pulling from a database already but that you will want to migrate them into Craft.  For these, you'll likely need to migrate things into the Craft database and then update your existing code to be integrated with this data.</p>
  
  <p>It's hard to be too specific without understanding more about how your current data is stored and what types of specific applications you'd need to be porting over.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-23T06:05:38.483Z
Answers.LastActivityDate: 2015-08-24T01:28:46.663Z
Answers.LastEditDate: 2015-08-24T01:28:46.663Z
Answers.UserDisplayName: Ben Parizek
Body: <p>I have a large site running Yii (1.1.x), complete with many controllers for specific applications.</p>
  
  <p>A big section of the site is "static" pages, which use Yii to render out using a site layout.</p>
  
  <p>I'm interested in migrating the "static" portions of the site into content management, but I need to keep my applications. Is there an easy way to create Craft plugins that will call my existing Yii controllers? Or is there some other way to port the functionality without rewriting everything?</p>
  
Tags: <plugin-development><migration>
Title: Migrating a Yii site to Craft
ThreadText: # Migrating a Yii site to Craft
  
  (Asked by: username_0 on 2015-05-27)
  
  I have a large site running Yii (1.1.x), complete with many controllers for specific applications.
  
  A big section of the site is "static" pages, which use Yii to render out using a site layout.
  
  I'm interested in migrating the "static" portions of the site into content management, but I need to keep my applications. Is there an easy way to create Craft plugins that will call my existing Yii controllers? Or is there some other way to port the functionality without rewriting everything?
  
  **Tags:** plugin-development, migration
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2015-05-28. Score: 2
  
  > Is there an easy way to create Craft plugins that will call my existing Yii controllers?
  
  There might be a way, but I'm not sure how easy it'd be.
  
  I think it'd be a more guaranteed easy path if you were to take your existing Yii controllers and turn them into Craft plugin [controllers](http://buildwithcraft.com/docs/plugins/controllers), but I'm not sure of the extent and complexity of your existing application.
  
  
  ---
  
  ### Answer by username_2 on 2015-08-23. Score: 2
  
  I don't think there is going to be an easy one-to-one mapping for migrating a Yii site to Craft. There may be several areas you can reuse code, but I expect you'll need to restructure things a bit to fit the Craft plugin architecture.
  
  You also mention a handful of static pages. It sounds like these pages are not pulling from a database already but that you will want to migrate them into Craft. For these, you'll likely need to migrate things into the Craft database and then update your existing code to be integrated with this data.
  
  It's hard to be too specific without understanding more about how your current data is stored and what types of specific applications you'd need to be porting over.
  
  
  ---
  
  