Dotclear


Ignore:
Timestamp:
11/10/14 15:46:31 (11 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Extends loopPosition in order to specify a modulo. Fixes #1978

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/public/lib.tpl.context.php

    r2676 r2774  
    5959 
    6060     # Loop position tests 
    61      public function loopPosition($start,$length=null,$even=null) 
     61     public function loopPosition($start,$length=null,$even=null,$modulo=null) 
    6262     { 
    6363          if (!$this->cur_loop) { 
     
    9494          if ($even !== null) { 
    9595               $test = $test && $index%2 == $even; 
     96          } 
     97 
     98          if ($modulo !== null) { 
     99               $test = $test && ($index % $modulo == 0); 
    96100          } 
    97101 
Note: See TracChangeset for help on using the changeset viewer.

Sites map