![]() |
Questions about transferring data to parse - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Model-View-Controller (https://forum.codeigniter.com/forumdisplay.php?fid=10) +--- Thread: Questions about transferring data to parse (/showthread.php?tid=63026) |
Questions about transferring data to parse - dangyuluo - 09-17-2015 Now I'm using parse to generate pages, and I attach an array with it, like the following: Code: private $data = array( As you can see, $data is an array and one of its element, css, is also an array. In the template I can use {title} to refer to 'title' element in $data, but how to use css array in view? Like {css:test} ? It doesn't work. RE: Questions about transferring data to parse - Martin7483 - 09-24-2015 Change your array from this: PHP Code: private $data = array( To this: PHP Code: private $data = array( In your template you can then loop an array by doing this Code: {css} // Start of the array, The parser will see it is an array More info on this in the user guide http://www.codeigniter.com/user_guide/libraries/parser.html?highlight=parser#variable-pairs |