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

Source for file Foreach.php

Documentation is available at Foreach.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 2.02 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/2_02.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:  Alan Knowles <alan@akbkhome>                               |
  17. // +----------------------------------------------------------------------+
  18. //
  19. // $Id: Foreach.php 329605 2013-03-01 01:59:25Z alan_k $
  20. //
  21.  
  22. /**
  23. * Class to handle foreach statements
  24. *
  25. *
  26. */
  27. class HTML_Template_Flexy_Token_Foreach extends HTML_Template_Flexy_Token {
  28.     
  29.     /**
  30.     * variable to loop on.
  31.     *
  32.     * @var string 
  33.     * @access public
  34.     */
  35.     var $loopOn '';
  36.     /**
  37.     * key value
  38.     *
  39.     * @var string 
  40.     * @access public
  41.     */
  42.     var $key    '';
  43.     /**
  44.     * optional value (in key=>value pair)
  45.     *
  46.     * @var string 
  47.     * @access public
  48.     */
  49.     var $value  ''
  50.     
  51.     /**
  52.     * Setvalue - a array of all three (last one optional)
  53.     * @see parent::setValue()
  54.     */
  55.   
  56.     function setValue($value{
  57.         $this->loopOn=$value[0];
  58.         if (!isset($value[1]|| !strlen(trim($value[1]))) {
  59.             // error condition.
  60.             return false;
  61.         }
  62.         $this->key=$value[1];
  63.         $this->value= isset($value[2]$value[2'';
  64.     }
  65.      function toString()
  66.     {
  67.         return '';
  68.     }
  69.  
  70. }

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