• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help me - array to parsing : using to Template Parser Class

#1
[eluser]Unknown[/eluser]
Code:
Array
(
    [0] => Array
        (
            [bmb_srl] => 1
            [bmb_name] => Personal
            [list] => Array
                (
                    [0] => Array
                        (
                            [bmb_srl] => 1
                            [bmm_srl] => 1
                            [bmm_name] => test1
                            [bmm_link] => http://test.com
                            [bmm_tag] =>
                            [bmm_no] =>
                        )

                    [1] => Array
                        (
                            [bmb_srl] => 1
                            [bmm_srl] => 2
                            [bmm_name] => test2
                            [bmm_link] => http://test.com
                            [bmm_tag] =>
                            [bmm_no] =>
                        )
                )

        )
    [1] => Array
        (
            [bmb_srl] => 2
            [bmb_name] => Project
            [list] => Array
                (
                    [0] => Array
                        (
                            [bmb_srl] => 2
                            [bmm_srl] => 4
                            [bmm_name] => test3
                            [bmm_link] => http://test.com
                            [bmm_tag] =>
                            [bmm_no] =>
                        )

                    [1] => Array
                        (
                            [bmb_srl] => 2
                            [bmm_srl] => 18
                            [bmm_name] => test4
                            [bmm_link] => http://test.com
                            [bmm_tag] =>
                            [bmm_no] =>
                        )

                    [2] => Array
                        (
                            [bmb_srl] => 2
                            [bmm_srl] => 178
                            [bmm_name] => test5
                            [bmm_link] => http://test.com
                            [bmm_tag] =>
                            [bmm_no] =>
                        )

                    [3] => Array
                        (
                            [bmb_srl] => 2
                            [bmm_srl] => 245
                            [bmm_name] => test6
                            [bmm_link] => http://test.com
                            [bmm_tag] =>
                            [bmm_no] =>
                        )
                )
        )
)

Code:
<html>
<head>
<title>test</title>
</head>
<body>
{bmb_name}
{list}
<h5>{bmm_name}</h5>
<p>{bmm_link}</p>
{/list}
{/bmb_name}
&lt;/body&gt;
&lt;/html&gt;


hello everybody!
array name is $ouput
how to do this progressing?

#2
[eluser]Phil Sturgeon[/eluser]
By this you mean your variable pased in the following code right?

Code:
$this->parser->parse('filename.hhtml', $output);

If so, make it $output['mainList'] or something, then just use the HTML:

Quote:&lt;html&gt;
&lt;head&gt;
&lt;title&gt;test&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
{mainList}
{bmb_name}
{list}
<h5>{bmm_name}</h5>
<p>{bmm_link}</p>
{/list}
{/bmb_name}
{/mainList}
&lt;/body&gt;
&lt;/html&gt;


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.