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

Source for file Var.php

Documentation is available at Var.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: Var.php 329605 2013-03-01 01:59:25Z alan_k $
  20. //
  21.  
  22. /**
  23. * Class to handle variable output
  24. *  *
  25. *
  26. */
  27.  
  28. class HTML_Template_Flexy_Token_Var extends HTML_Template_Flexy_Token 
  29.     
  30.     /**
  31.     * variable modifier (h = raw, u = urlencode, none = htmlspecialchars)
  32.     *
  33.     * @var char 
  34.     * @access public
  35.     */
  36.     var $modifier;
  37.     /**
  38.     * Setvalue - at present raw text.. - needs sorting out..
  39.     * @see parent::setValue()
  40.     */
  41.     function setValue($value{
  42.         // comes in as raw {xxxx}, {xxxx:h} or {xxx.yyyy:h}
  43.        
  44.         if (strpos($value,":")) {
  45.             list($value,$this->modifierexplode(':',$value);
  46.         }
  47.         $this->value $value;
  48.     }
  49.      
  50.     /**
  51.      * used to get the contents..
  52.      */
  53.     function toString()
  54.     {
  55.         return '{' $this->value ($this->modifier ':' ''.  $this->modifier .'}';
  56.         
  57.     }
  58.  
  59. }

Documentation generated on Mon, 11 Mar 2019 16:00:04 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.