Welcome Guest, Not a member yet? Register   Sign In
Indexes In CI?
#1

[eluser]aataqwa[/eluser]
how to get indexes in CI...?

if in Smarty
Code:
{section loop=$results name=i}
{if $results[i].id != $results[i.index_prev.id}

how in CI get function index_prev..?

thx regards,
#2

[eluser]OES[/eluser]
Well by asking how to get indexs in Smarty it has nothing to do with CI.

for a start I would always use foreach so in your example I would do.

Code:
{foreach from=$results key=k item=i name=foo}
  // Then you can access all the foreach modifiers. ie
  // {$smarty.foreach.foo.index}
  // {$smarty.foreach.foo.iteration}
  // etc etc
{/foreach}

You can check the full list here.

http://www.smarty.net/manual/en/language...oreach.php

Hope this helps




Theme © iAndrew 2016 - Forum software by © MyBB