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

Source for file LRTB.php

Documentation is available at LRTB.php

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4: */
  3. // +----------------------------------------------------------------------+
  4. // | PHP version 4                                                        |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (c) 1997-2002 The PHP Group                                |
  7. // +----------------------------------------------------------------------+
  8. // | This source file is subject to version 3.0 of the PHP license,       |
  9. // | that is bundled with this package in the file LICENSE, and is        |
  10. // | available at through the world-wide-web at                           |
  11. // | http://www.php.net/license/3_0.txt.                                  |
  12. // | If you did not receive a copy of the PHP license and are unable to   |
  13. // | obtain it through the world-wide-web, please send a note to          |
  14. // | license@php.net so we can mail you a copy immediately.               |
  15. // +----------------------------------------------------------------------+
  16. // | Authors: Ian Eure <ieure@php.net>                                    |
  17. // +----------------------------------------------------------------------+
  18. //
  19. // $Id: LRTB.php 286815 2009-08-04 19:59:06Z cweiske $
  20.  
  21. require_once 'HTML/Table/Matrix/Filler.php';
  22.  
  23. /**
  24.  * Fill left-to-right, top-to-bottom.
  25.  *
  26.  * @author Ian Eure <ieure@php.net>
  27.  * @package HTML_Table_Matrix
  28.  * @since 1.0
  29.  */
  30.     /**
  31.      * Constructor
  32.      *
  33.      * @param Object $matrix Reference to the HTML_Table_Matrix instance we are
  34.      *                        filling data for.
  35.      * @param array $options Options for this Filler
  36.      * @return void 
  37.      */
  38.     function HTML_Table_Matrix_Filler_LRTB(&$matrix$options = false{
  39.         $this->setOptions($options);
  40.         $this->matrix = &$matrix;
  41.     }
  42.  
  43.     /**
  44.      * Get the next cell.
  45.      *
  46.      * @param int $index Where we're at in the data-set
  47.      * @return array 1-dimensional array in the form of (row, col) containing the
  48.      *                coordinates to put the data for this loop iteration
  49.      */
  50.     function next($index{
  51.         if ($index == 0{
  52.             $this->row = $this->matrix->_fillStartRow;
  53.             $this->col = $this->matrix->_fillStartCol;
  54.         else {
  55.             $this->col++;
  56.             if ($this->col >= $this->matrix->_cols{
  57.                 $this->col = $this->matrix->_fillStartCol;
  58.                 $this->row++;
  59.             }
  60.         }
  61.  
  62.         return array($this->row$this->col);
  63.     }
  64. }
  65. ?>

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