PHP Classes
Icontem

File: alternarColor.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Alfredo Rahn  >  AlternarColor array iterator  >  alternarColor.php  
File: alternarColor.php
Role: Class source
Content type: text/plain
Description: This is the main class
Class: AlternarColor array iterator
Loop an array endlesly, returns current element
 

Contents

Class file image Download
<?php
/**
* Alterna los colores para fondo
*
* @author Alfredo Rahn <arahn@yahoo.com>
* @version 0.1 (09-08-2005)
*/
class alternarColor {
    
/**
     * Colores entre los que se puede alternar
     * @var array
     */
    
var $colores;
    
/**
     * Color actual
     * @var integer 
     */
    
var $color;
    
/**
    * Constructor de la clase
    * @param array $colorin Lista de los colores para alternar
    */
    
function alternarColor ($colorin = array("darkred","yellow","darkgreen")) { 
        
$this->colores $colorin
        
$this->color = -1;
    }
    
/**
    * Incrementa la posición e imprime el nombre de color correspondiente 
    */
    
function imprimir () {
        (++
$this->color >= count($this->colores)) and $this->color 0;
        return 
$this->colores[$this->color];
    }
}
?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products