good idea, to create a method that just sets the conditions and then send them to the index. it does save some coding.
thanks On Feb 14, 7:18 am, WebbedIT <[email protected]> wrote: > There aren't any hard and fast rules to be followed, but I generally > try and index/view records within the controller they are from, it > just makes more sense that way. > > I am currently designing a social portal where good causes publish > articles, blogs, events etc. which can be viewed by looking at their > profile (therefore only seeing their content) or within the portal > which indexes the combined content of all causes. > > After many variations on how I should structure my controllers/urls I > have opted for having a main index action which by default lists all > records. I then have two other actions called 'cause' and 'tagged' > which set whatever extra variables are required for the view and then > call $this->index passing in some variables to alter conditions and > create required binding changes etc. > > My urls are as followshttp://www.website.com/articles(Index of all > articles)http://www.website.com/articles/cause/CauseSlug(Index of cause's > articles)http://www.website.com/articles/tagged/id:slug(Index of articles with > specified tag)http://www.website.com/articles/view/id:slug(view of article) > > The index action also checks if the file extension for any of these > views is RSS and creates an RSS feed. Users can also list articles > from causes in regions and categories of interest to them by setting > content filters, or from only the causes that they have added to their > supported list. All lists can be reordered by Date Published, Most > Viewed or Most Commented etc. so having the majority of this work done > by the one main index action saved me a lot of duplicated code. > > Not sure if this is exactly what you were asking, but hope it's of > some help. > > HTH > > Paul. > > P.S. I would provide some links, but it's very much a work in progress > still, hopefully launching the site at end of month. 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
