On 13 nov, 03:53, Nick <[EMAIL PROTECTED]> wrote: > Basically I am using wildflower cms which is built on cakephp. > It routes are setup so that / goes to the pages controller. > I am building a product catalog and could simply have the urls be / > products/category/product-name > however I do not want to prepend the controller name in this scenario. > Right now I have it so that the product controller from the admin side > will insert rows into the pages table as products are created in the > products table. Also I created a field in the pages table called > "controller". By default it is blank however what I want to do is if > it isn't blank and for example has "Products" in it then I want to > load the Products controller from within the Pages controller so that > it can handle pulling the product images, pricing, etc... > > I want the controller to be dynamically called. That's a terrible idea, would cost you so much in performance, maitainability and logic. I think you should re-think your design principles, trying to keep it a little more simple and tided to a rule. Maybe moving some logic to the model side - Fat Model, Skinny Controller - you could dynamically load a Model class, wich would make much more sense and would be much lighter. You'd only have to create a pattern for your models so that they could be easily used by the same controller - like an interface. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Re: How to dynamically load controller based on field in database.
Rafael Bandeira aka rafaelbandeira3 Thu, 13 Nov 2008 02:05:01 -0800
- How to dynamically load controller bas... Nick
- Re: How to dynamically load contr... [EMAIL PROTECTED]
- Re: How to dynamically load contr... Rafael Bandeira aka rafaelbandeira3
