Welcome Guest, Not a member yet? Register   Sign In
Parser libraby doesn't show non-nested variables
#1

(This post was last modified: 02-16-2015, 12:18 AM by griser.)

Controller function:
PHP Code:
public function test()
 {
 
$data = array('non_nested'   => 'this is non-nested string','blog_entries' => array( array('title' => 'Title 1''body' => 'Body 1'),array('title' => 'Title 2''body' => 'Body 2'),array('title' => 'Title 3''body' => 'Body 3') ) );
 
 $this->parser->parse('test_view',$data);
 } 

Veiew file (test_view.php):
Code:
<html>
<head>
<title>test</title>

</head>
<body>
<div>
{blog_entries}
       <div><span>{title}</span> <span>{body}</span>{non_nested}</div>
{/blog_entries}
</div>

</body>
</html>

Outputs:

Title 1 Body 1{non_nested}
Title 2 Body 2{non_nested}
Title 3 Body 3{non_nested}

Should output:

Title 1 Body 1this is non-nested string
Title 2 Body 2this is non-nested string
Title 3 Body 3this is non-nested string

Tested on CI3.0RC2 - php version 5.5.19, on CI2.0 works fine
Reply


Messages In This Thread
Parser libraby doesn't show non-nested variables - by griser - 02-16-2015, 12:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB