01-10-2010, 10:32 AM
[eluser]sigork[/eluser]
I took ready examples but sorry, I cannot connect them:
Controller from http://ellislab.com/codeigniter/user-gui...arser.html
View from http://wiki.dwoo.org/index.php/Syntax#Blocks
And I get:
Smth is wrong, I don't know what
EDIT
I think I found the solution:
I took ready examples but sorry, I cannot connect them:
Controller from http://ellislab.com/codeigniter/user-gui...arser.html
Code:
function index()
{
$data = array(
'blog_title' => 'My Blog Title',
'blog_heading' => 'My Blog Heading',
'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')
)
);
$this->parser->parse(THEMEDIR.'test_view', $data);
}
View from http://wiki.dwoo.org/index.php/Syntax#Blocks
Code:
<head>
<title>{$blog_title}</title>
</head>
<body>
<h3>{$blog_heading}</h3>
{foreach $blog_entries title body}
<h5>{$title}</h5>
<p>{$body}</p>
{/foreach}
Quote:My Blog Heading
0
Array
1
Array
2
Array
3
Array
4
Array
Smth is wrong, I don't know what

EDIT
I think I found the solution:
Code:
{loop $blog_entries title body}
<h5>{$title}</h5>
<p>{$body}</p>
{/loop