Hi, If you need this for only a single page then it would be fine to write the 'if' conditions to that action otherwise you can use beforeRender() callback to change view file's name to render.
Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Thu, Jan 13, 2011 at 2:47 AM, OldWest <[email protected]> wrote: > Hello, > > I have a table that has 5 fields of data. > > In many cases, not all of the fields have data in them. > > Each time the View action of the Controller is requested, I would like > to only display the fields that have content in them AND the tabular > structure of the data will change based on the content as well. > > So basically, I think I will need a unique View file for each type of > data schema. And there are 3 schemes. For example, > > Schema | 1 | 2 | 3 | 4 | 5 | > > A X X X X X > B X X X > C X X X > > As you can see, each schema has different data populated. > > This tells me I will need 3 View structures to accommodate these > schema's. > > Can anyone make a recommendation on the best way to handle this in the > CakePHP framework. I am thinking an if condition in the Controller, > and then render() based on that, but its seems there would be a more > conventional method. > > Thanks for any thoughts on this. > > > 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]<cake-php%[email protected]>For > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > 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
