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

Source for file Method.php

Documentation is available at Method.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: Method.php 329605 2013-03-01 01:59:25Z alan_k $
  20. //
  21.  /**
  22. * Class to handle method calls
  23. *  *
  24. *
  25. */
  26.  
  27. class HTML_Template_Flexy_Token_Method extends HTML_Template_Flexy_Token 
  28.     /**
  29.     * variable modifier (h = raw, u = urlencode, none = htmlspecialchars)
  30.     * TODO
  31.     * @var char 
  32.     * @access public
  33.     */
  34.     var $modifier;
  35.     /**
  36.     * Method name
  37.     *
  38.     * @var char 
  39.     * @access public
  40.     */
  41.     var $method;
  42.     /**
  43.     * is it in if statement with a method?
  44.     *
  45.     * @var boolean 
  46.     * @access public
  47.     */
  48.     var $isConditional;
  49.     /**
  50.     * if the statement is negative = eg. !somevar..
  51.     * @var string 
  52.     * @access public
  53.     */
  54.     var $isNegative '';
  55.  
  56.     /**
  57.     * arguments, either variables or literals eg. #xxxxx yyyy#
  58.     * 
  59.     * @var array 
  60.     * @access public
  61.     */
  62.     var $args= array();
  63.     /**
  64.     * setvalue - at present array method, args (need to add modifier)
  65.     * @see parent::setValue()
  66.     */
  67.     
  68.     function setValue($value{
  69.         // var_dump($value);
  70.         $method $value[0];
  71.         if (substr($value[0],0,3== 'if:'{
  72.             $this->isConditional = true;
  73.             if ($value[0]{3== '!'{
  74.                 $this->isNegative '!';
  75.                 $method substr($value[0],4);
  76.             else {
  77.                 $method substr($value[0],3);
  78.             }
  79.         }
  80.         
  81.         if (strpos($method,":")) {
  82.             list($method,$this->modifierexplode(':',$method);
  83.         }
  84.         $this->method $method;
  85.         
  86.         $this->args $value[1];
  87.         // modifier TODO!
  88.         
  89.     }
  90.     function toString()
  91.     {
  92.         return '{' $this->method '('implode(',' $this->args ')' .  
  93.             ($this->modifier ':' ''.  $this->modifier .'}';
  94.         
  95.     }
  96. }

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