[phplib-dev] RFC: Changes to template.inc From: Sebastian Bergmann (sb <email protected>)
Date: 09/22/00

  I'd like to propose some changes, nothing major, to PHPLIB's Template
class in order to allow for variable delimiters:

  class Template
  {
    // ...

    var $delimiters;

    // ...

    function Template( $root = false, $unknowns = "remove",
                       $delimiters = "{ }" )
    {
      // ...

      // set delimiters for template variables
      $this->set_delimiters( $delimiters );
    }

    // ...

    function set_delimiters( $delimiters = "{ }" )
    {
      $this->delimiters = explode( " ", $delimiters );
    }

    // ...

    function varname( $varname )
    {
      return preg_quote( $this->delimiters[ 0 ] .
                         $varname .
                         $this->delimiters[ 1 ]
                       );
    }

    // ...
  }

  Unfortuneately I'm not used to regular expressions and can therefore not
make the required changes to methods finish(), get_undefined() and
implode_block(), so as for now those methods would still use the hard-coded
"{" and "}" delimiters.

-- 
 <?php $a=explode(" " ,"119 130 128 129 45 110 123 124 129 117 114 127 45 ".
 "125 117 125 45 117 110 112 120 114 127");for($i=0;$i<sizeof($a);$i++)print
 chr($a[$i]-13); /* http://sb.phpOpenTracker.de | sb <email protected> */ ?>

--------------------------------------------------------------------- To unsubscribe, e-mail: phplib-dev-unsubscribe <email protected> For additional commands, e-mail: phplib-dev-help <email protected>