Welcome Guest, Not a member yet? Register   Sign In
Use deep nested array in view parser
#1

(This post was last modified: 12-28-2022, 09:31 AM by sjender.)

Hi, I have this array:

Code:
[nav:footer] => Array
        (
            [0] => Array
                (
                    [name] => home
                    [link] =>
                    [children] => Array
                        (
                            [0] => Array
                                (
                                    [name] => child1
                                    [link] => link1
                                )

                            [1] => Array
                                (
                                    [name] => child2
                                    [link] => link2
                                )

                        )

                )

            [1] => Array
                (
                    [name] => Contact
                    [link] => contact.php
                    [children] => 

                )

        )


And my view is:

PHP Code:
{{nav:footer}}
<
h1>{{name}}</h1>
<
h2>{{link}}</h2>


{{
children}}
    <h3>{{name}}</h3>
    <h4>{{link}}</h4>
{{/
children}}

{{/
nav:footer}} 


And this results in:

Code:
home
{{children}}
home
{{/children}}
Contact
contact.php
{{children}}
Contact
contact.php
{{/children}}

The children are obviously not parsed.
Is there a way to achieve this (and even deeper) without having to use php?
Reply


Messages In This Thread
Use deep nested array in view parser - by sjender - 12-28-2022, 09:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB