构造一个简单的行数组

时间:2014-05-11 19:42:39

标签: php laravel

我正在尝试在laravel中创建一个非常简单的cms,除了父页面和子页面的排序外,我已经完成了所有工作。

我的表格如下:

page_id | page_title | page_content | page_parent

我意识到我可以在我的项目中包含很多解决方案,但是为这样一个微不足道的任务导入一些东西似乎很疯狂!

我想这个过程是这样的:

Build array via a foreach loop

1. Add first row to array
2. Check if the id of this row, is in page_parent row
3. If it is -> get the id of the matching row and add to the array 
4. If it is not -> add the next row to array
5. Repeat step 2.

提前谢谢!

0 个答案:

没有答案