Yii Framework Forum: Dir structure and code reuse -> Best methods? - Yii Framework Forum

Jump to content

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

Dir structure and code reuse -> Best methods? Rate Topic: -----

#1 User is offline   intel352 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 196
  • Joined: 05-February 10
  • Location:Southport, NC

Posted 18 February 2010 - 09:23 AM

Hey all, I am converting our existing legacy procedural CRM to Yii.
I've already built out the tables and generated models, controllers/crud, but I have a question for best method to structure my files with Yii.


Currently, we have the structure of:
/var/www/dev/lib/ << shared code
/var/www/dev/crm.domain.com/public/ << doc root of CRM
/var/www/dev/www.domain.com/public/ << doc root of one-of-many additional domains representing our company

(Note that the path is /var/www/dev/, as we have dev, test, and prod environments)

What is the best way to keep a similar structure, preventing code duplication, and allowing each non-CRM domain to be able to read data from (and insert into) the CRM? I would like to have all CRM-related content to be subject to CRM-controlled rules, validation, etc, so that the www domains are just a content passthru.

I would like to see something like:

/var/www/dev/lib/yiiframework/
/var/www/dev/lib/base_crm_application/ << base crm app code

/var/www/dev/crm.domain.com/private/ << crm application extending from the base crm app
/var/www/dev/crm.domain.com/public/ << crm doc root (index.php and related files)

/var/www/dev/www.domain.com/private/ << www application extending the base crm app
/var/www/dev/www.domain.com/public/ << www doc root


Is this do-able? If so, implemented how?

Or, is there a better way to achieve the same goal?

Thanks

-Jon
Need live Yii support? - Join the #yii IRC channel on Freenode!
0

#2 User is offline   intel352 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 196
  • Joined: 05-February 10
  • Location:Southport, NC

Posted 18 February 2010 - 10:02 AM

Looks like this article solves my dilemma:

http://www.yiiframew...oc/cookbook/33/
Need live Yii support? - Join the #yii IRC channel on Freenode!
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