Login   Register  
PHP Classes
elePHPant
Icontem

File: gPlugins/gPlugin.cycle.inc.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of unknown man  >  Gedar Template Engine  >  gPlugins/gPlugin.cycle.inc.php  >  Download  
File: gPlugins/gPlugin.cycle.inc.php
Role: Auxiliary script
Content type: text/plain
Description: plugin
Class: Gedar Template Engine
Compiling template engine with plug-in support
Author: By
Last change:
Date: 2005-10-28 06:39
Size: 991 bytes
 

Contents

Class file image Download
<?php
  
/**
   * Gedar Template Engine plugin
   * @package Gedar
   * @subpackage plugins
   */

  /**
   * Gedar {cycle} function<br/>
   *<br/>
   * <b>Type:</b>     function<br/>
   * <b>Name:</b>     cycle<br/>
   * <b>Purpose:</b>  rotate between set of values<br/>
   * @authur  ali masoudi <me@alimasoudi.com>
   * @param   array $name
   * @param   object $gedar
   * @see     _compileCycleTag()
   * @return  the current item during cycling
   */
function gedar_cycle_do($name,&$gedar)
{
  static 
$no=0;
  
$no=!$no?0:$no;
  
$gedar->_tmpVar=stripslashes($gedar->_TplSpecialVars["_cycle"][$name]["elements"]);
  eval(
'$items='.$gedar->_tmpVar.';');
  
$Items=explode(',',$items);
  
$gedar->_TplSpecialVars['_cycle'][$name]['no']=count($Items);
  
$gedar->_TplVars['_cycle'][$name]=$Items[$no];
  
$no++;
  
$no=$no%$gedar->_TplSpecialVars['_cycle'][$name]['no'];
  
$gedar->_outputVal=$gedar->_TplVars['_cycle'][$name];
  return 
$gedar->_outputVal;
}
?>