Helper Count |
[eluser]perdel[/eluser]
Hi! I was using Pyro Cms recently, and now i am moving my project to codeigniter, but i have a problem: in pyro cms, in the views, you can use the Helper:Count to count the number of items being output in a tag loop: Code: {{ blog:posts }} This is very useful, but i dont see in codeigniter anything like this. Thanks!
[eluser]pbflash[/eluser]
That's a plugin that is specific to PyroCMS and the template parser that they use.
[eluser]perdel[/eluser]
[quote author="pbflash" date="1337814117"]That's a plugin that is specific to PyroCMS and the template parser that they use.[/quote] And there is something like this in codeigniter? or someone has a library to do this? Thanks for the answers ![]()
[eluser]Aken[/eluser]
Basic PHP. Easy peasy. Code: $i = 10;
[eluser]perdel[/eluser]
[quote author="Aken" date="1337816768"]Basic PHP. Easy peasy. Code: $i = 10; thank you very much!! I thought to do this i need for ($i = 10)... ![]()
[eluser]Aken[/eluser]
for() creates a loop. If you're already looping through something using foreach(), you can just increase the count of a variable to see what iteration you're on. |
Welcome Guest, Not a member yet? Register Sign In |