php - multilevel menu with multilevel array -
Just ask someone to solve this problem?
I want to create a multilevel menu I can not find the right solution generated with multilevel array, it always gets an array_push error My study came from the original idea
But still my Can not match the need.
This is my MySQL
[code] ----- --------------------- --------------- | ID | PARENT_ID | Name | Link | Seq | 1 | 0 | Dashboad | Dashboard / | 1 | 2 | 0 | Menu 1 | Menu 1 / | 2 | 3 | 0 | Menu 2 | Menu 2 / | 3 | 4 | 0 | Menu 3 | Menu 3 / | 4 | 5 | 2 | Joint Add / | 1 | 6 | 3 | Joint Add / | 1 | 7 | 2 | Edit | Edit / | 2 | 8 | 4 | Joint Add / | 1 ------------------------------------------ [/ Code]
I want to do something like this in my array
array ('dashboard' = & gt; array ('id' = & gt; '' 'Dame' = & gt; 'Dashboard', 'Title' = & gt; 'Dashboard', 'MatchMin' = & gt; Base_URL (). 'Dashboard /', 'Active' => = & Gt; NULL), 'menu1' = & gt; array ('id' => gt; '' 'name' = & gt; 'menu1', 'title' = & gt; 'menu1', 'permalink '= & Gt; base_url () (' id '= & gt; array (' id '=> gt;' '' name '= & gt; add' ',' '1' ',' name '= & Gt; 'Title' = & gt; 'Add', 'Paramik' = & gt; Base_URL (). 'Menu1 / add', 'Active' = & gt; False, 'child '= & Gt; NULL),' Edit '= & gt; array (' Id '=> gt;' '' name '= & gt;' edit ',' title '= & gt; , 'Permalink' = & gt; base_url (). 'Menu1 / edit /', 'active' = & Gt; incorrect, 'child' => NULL)), ......... .......... [similar to the above]);
I was able to push_array only, but there is a warning warning: array_push () [function.array-push]: The first argument should be an array
I was discussing this question with a lot of things, but after doing some research, most cases are doing multi-level menus but in a level array, I want to get some multilevel array, can anyone help?
Temporary array I am using a constant type.
I will be advised that
& amp;
Among those two ideas, you can get a very practical array of trees which are going to build the need for you.
Comments
Post a Comment