Jump to content

Unique View for 3 different table data schema's - View should display based on


OldWest

Recommended Posts

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.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.