help templates |
[eluser]zyklon[/eluser]
Hi.Can someone help me with sending arrays to templates?I can't make the arrays right.I pay.
[eluser]aart-jan[/eluser]
Have you read the user guide on templates? It's explained there: http://ellislab.com/codeigniter/user-gui...arser.html Code: <html>
[eluser]zyklon[/eluser]
Yes but i am talking about template that looks like: {specification_categories} <div class="specs"> <div class="blue_11_bold"><span class="specs_title">{specification_category_name}</span></div> {subspecifications} <div class="specs_gray"> <div class="specs_left">{subspecification_name}</div> <div class="specs_right">{subspecification_value}</div> </div> {/subspecifications} </div> {/specification_categories} So 2 loops
[eluser]aart-jan[/eluser]
If the template parser does not support nested arrays I think best solution would be to move the subspecfications to a seperate template and use this wiki page on usage of multiple templates to achieve your desired result: http://codeigniter.com/wiki/Displaying_M...Templates/
[eluser]esra[/eluser]
[quote author="aart-jan" date="1196975768"]If the template parser does not support nested arrays I think best solution would be to move the subspecfications to a seperate template and use this wiki page on usage of multiple templates to achieve your desired result: http://codeigniter.com/wiki/Displaying_M...Templates/[/quote] bTemplate is a light template library that does support nested loops, conditionals, and a few other features not supported by Parser. After installing bTemplate.php in application/libraries, you can load it like any other library. If you do a search on the forums, you should get some hits with examples of usage.
[eluser]zyklon[/eluser]
I am trying to use bTemplate,but i am getting an error: Unable to load the requested class: btemplate The code is: Code: $this->load->library('bTemplate');
[eluser]esra[/eluser]
Take a look at this thread for sample code. http://ellislab.com/forums/viewthread/47981/
[eluser]zyklon[/eluser]
Actually the problem was that the first letter of the library name must be capitalized.Like Btemplates not bTemplates. |
Welcome Guest, Not a member yet? Register Sign In |