Loop through multiple array concat and sort by value |
I have a array that describe a database table and it's relations.
Assume we have a products table with following fields:
and based on the table I create a object with the details. PHP Code: Array How can I loop this array in view so I can get the labels to create a table with the following thead ordered by position? Column1 | Category Name | Column2 | Column Three | Image Name When merging the arrays must check if a field from main table has same name with from relation table and if yes add a suffix.
I would suggest that you build your page array in a controller or library and only pass the data to your page that your view actually requires and in a format fit for that view. This will help you to avoid complex array manipulation within a view.
|
Welcome Guest, Not a member yet? Register Sign In |