Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>For "sub-views" look into Elements, which are just that. They are snippets of view code that can be included in other views. The proper structuring of elements can create some very elegant view/subview relationships. <a href="http://book.cakephp.org/view/1081/Elements" rel="nofollow noreferrer">http://book.cakephp.org/view/1081/Elements</a></p> <p>As for your controller issue, it's one I've grappled with as well. From what I see, it sounds like you're misclassifying your actions. Think about alternative taxonomies for the actions you're doing (mixing all the search functions together into a controller is a great example). </p> <p>Perhaps you should think about controllers as objects that classify various actions rather than aspects of your site on which various actions can be performed (as it seems you're doing). So rather than a CATEGORY controller on which you can search, list, buy, etc., you might have, the product controller (which handles viewing your products either in an aggregate - perhaps by category - or individually), and perhaps a user controller for your users accounts? It's hard to say without looking at your application specifics. Search would then be an <strong>action</strong> that would be performed on your <strong>product</strong>.</p> <p>One thing that I have made the mistake of doing is picking my controllers based on <strong>pages</strong> i'll have rather than on <strong>models</strong>. Think about your data (models) and the actions that can be performed on them (actions in the controller), THEN think about your views.</p> <p>I wish I could give you more specific help, but without knowing your application's specific needs, I can only give you guidelines on how to break down your controllers. Take a look at this question:</p> <p><a href="https://stackoverflow.com/questions/5476598/cakephp-file-structure-confusion-different-controllers-or-all-in-same">CakePHP - file structure confusion - different controllers, or all in same?</a></p> <p>for more discussion on the topic. </p> <p>Hope that helps!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload