Welcome Guest, Not a member yet? Register   Sign In
Using the Parser library with flat arrays?
#1

[eluser]Matthew Pennell[/eluser]
I like to stick to the Parser library in my views, but one problem I have is that it doesn't seem to allow you to pass in one-dimensional arrays.

So this:

Code:
$data['blog_entries'] = array(
    array('title' => 'Title 1', 'body' => 'Body 1'),
    array('title' => 'Title 2', 'body' => 'Body 2'),
    array('title' => 'Title 3', 'body' => 'Body 3'),
    array('title' => 'Title 4', 'body' => 'Body 4'),
    array('title' => 'Title 5', 'body' => 'Body 5')
);

becomes this:

Code:
{blog_entries}
<h5>{title}</h5>
<p>{body}</p>
{/blog_entries}

But what if I want to pass in this:

Code:
$data['countries'] = array('England', 'Ireland', 'Scotland', 'Wales');

?


Messages In This Thread
Using the Parser library with flat arrays? - by El Forum - 02-04-2008, 10:42 AM
Using the Parser library with flat arrays? - by El Forum - 02-04-2008, 10:57 AM
Using the Parser library with flat arrays? - by El Forum - 02-04-2008, 10:58 AM
Using the Parser library with flat arrays? - by El Forum - 02-04-2008, 06:57 PM
Using the Parser library with flat arrays? - by El Forum - 02-05-2008, 01:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB