[phplib] template->parse() From: Luca - De Whiskey's - De Vitis (devitis <email protected>)
Date: 07/15/00

When $vaname is an array $append is not considered:

      while(list($i, $h) = each($varname)) {
        $str = $this->subst($h);
        $this->set_var($target, $str);
      }

Shouldn't it be instead?

What about this:

  function parse($target, $varname, $append = false) {
    if (!is_array($varname)) { $varname = array($varname); }
    reset($varname);
    while(list($i, $h) = each($varname)) {
      $str = $this->subst($h);
      if ($append) {
        $this->set_var($target, $this->get_var($target) . $str);
      } else {
        $this->set_var($target, $str);
      }
    }
  }

-- 
Luca - De Whiskey's - De Vitis
aliases: Luca ^De [a-zA-Z]*i'?s$
Undergraduate Student of Computer Science at Bologna University.
e-mail: devitis at (students\.)?cs\.unibo\.it
home page: http://(caristudenti|www)(\.students)?\.cs\.unibo\.it/~devitis

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