CodeIgniter Forums
parser loop problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: parser loop problem (/thread-70370.html)



parser loop problem - faik_guler - 03-31-2018

Hello friends,

PHP Code:
$data = array(
 
       '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')
 
       )
); 


i write 

PHP Code:
{blog_entries}
     {
blog_heading}
     {
title}
{/
blog_entries

but blog_heading not writing how can i write in a loop ? blog_heading and title but main title ? 

be very hapy if you can help me 
thanks.


RE: parser loop problem - InsiteFX - 04-01-2018

SEE: Usage Notes


RE: parser loop problem - faik_guler - 04-01-2018

inadequate source . it does not work for me.


RE: parser loop problem - InsiteFX - 04-02-2018

Then I must guess that you are not using the $template.


RE: parser loop problem - SomeGuy - 04-06-2018

Hoping you figured it out... but, without ever having used this templating engine, you're attempting to output blog_heading while you're looping over blog_entries...

Code:
{blog_heading}
{blog_entries}
     {title}
{/blog_entries}

But, maybe not.