OldWest Posted January 12, 2011 Share Posted January 12, 2011 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. Link to comment https://forums.phpfreaks.com/topic/224233-unique-view-for-3-different-table-data-schemas-view-should-display-based-on/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.