> > PS additional app paths and plugins don't solve the same problem. >
Firstly, thanks for these responses. I appreciate it. Plugins and Additional paths may not solve the same problem, I agree, and that's sort of what I am trying to determine, ie. whether I should keep all my code as additional paths, or reorganize it as a bunch of plugins. > > I'm kind of scared what you've been up to if for you they are interchangable. > I have two main directories parallel to app/ called base_cms/ and base_ecommerce/ , each containing several subfolders, as follows: app/ base_cms/ ---------- accounts/ ---------- addresses/ ---------- admin_panel/ ---------- articles/ ---------- catalog/ ---------- configs/ ---------- filters/ ---------- comments/ ---------- images/ ---------- sitemaps/ base_ecommerce/ ---------- coupons/ ---------- orders/ ---------- partners/ ---------- payments/ ---------- products/ ---------- shipping/ cake/ vendors/ Each of the subfolders contains one or even several base controllers, components, models, behaviors, views, elements, helpers, etc. as a group of closely knit functionality. All these files are base classes, so they can (and are) extended at the app level to build any app for any client. For example, the accounts subfolder contains the base model classes: BaseAccount, BaseAcountGroup, BaseAccountProfile, BaseAccountAddress, etc. and all it's associated base controllers, views, elements, behaviors, etc. I also have child Account, AccountGroup, AccountProfile, AccountAddress models in the base accounts folder, which are simple empty extensions of their Base parent files, and are the files cake instantiates. So in base_cms/accounts/: BaseAccount extends AppModel - full of code. Account extends BaseAccount - empty. To override at app/ level for any client, I copy Account.php to app level and have: Account extends BaseAccount - override whatever functionality I want. The app/Account.php is chosen by cake over the base_cms/accounts/ Account.php due to search path ordering. When a new customer comes along, I add his unique code to app/, and just extend/override much of the stuff in my base_cms/ and base_ecommerce/ folders. At the time I started this, it was not even possible for an app to access a plugin's model, let alone have one plugin access another plugin's models, so I took the additional paths approach. It may be it is still the correct approach, and plugin usage should be limited to app independant code. That's fine. It's now more than 3 years later, plugins are more powerful and integrateable into the main app, so I was exploring whether my current architecture is still correct, or I should be considering using plugins instead of my current subfolder strategy. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
