HTML_Table_Matrix
[ class tree: HTML_Table_Matrix ] [ index: HTML_Table_Matrix ] [ all elements ]

Source for file RLBT.php

Documentation is available at RLBT.php

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4: */
  3. require_once 'HTML/Table/Matrix/Filler.php';
  4.  
  5. /**
  6.  * Fill left-to-right, bottom-to-top.
  7.  *
  8.  * @author Arpad Ray <arpad@rajeczy.com>
  9.  * @package HTML_Table_Matrix
  10.  */
  11.     /**
  12.      * Constructor
  13.      *
  14.      * @param Object $matrix Reference to the HTML_Table_Matrix instance we are
  15.      *                        filling data for.
  16.      * @param array $options Options for this Filler
  17.      * @return void 
  18.      */
  19.     function HTML_Table_Matrix_Filler_RLBT(&$matrix$options = false{
  20.         $this->setOptions($options);
  21.         $this->matrix = $matrix;
  22.     }
  23.  
  24.     /**
  25.      * Get the next cell.
  26.      *
  27.      * @param int $index Where we're at in the data-set
  28.      * @return array 1-dimensional array in the form of (row, col) containing the
  29.      *                coordinates to put the data for this loop iteration
  30.      */
  31.     function next($index{
  32.         if ($index == 0{
  33.             $this->row = $this->matrix->_rows - 1;
  34.             $this->col = $this->matrix->_cols - 1;
  35.         else {
  36.             $this->col--;
  37.             if ($this->col < $this->matrix->_fillStartCol{
  38.                 $this->col = $this->matrix->_cols - 1;
  39.                 $this->row--;
  40.             }
  41.         }
  42.  
  43.         return array($this->row$this->col);
  44.     }
  45. }
  46. ?>

Documentation generated on Mon, 11 Mar 2019 15:32:39 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.