MkFramework
 All Data Structures Functions
plugin_tpl.php
1 <?php
2 /*
3 This file is part of Mkframework.
4 
5 Mkframework is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License.
8 
9 Mkframework is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
13 
14 You should have received a copy of the GNU Lesser General Public License
15 along with Mkframework. If not, see <http://www.gnu.org/licenses/>.
16 
17 */
23 class plugin_tpl{
24 
25  static protected $tAlternate;
26 
27 
34  public static function alternate($tab,$uRef=0){
35  if(!isset(self::$tAlternate[$uRef])){
36  self::$tAlternate[$uRef]=0;
37  }else{
38  self::$tAlternate[$uRef]+=1;
39  }
40  if(self::$tAlternate[$uRef] >= count($tab)){
41  self::$tAlternate[$uRef]=0;
42  }
43  return $tab[self::$tAlternate[$uRef] ];
44  }
45 
46 
47 }
static alternate($tab, $uRef=0)
Definition: plugin_tpl.php:34