public function append($tag, $value, $encode = true)
    {
        if ($value instanceof URL) {
            $value = $value->__toString();
        }
        // Temporary here until we finish testing
        if ($encode
            && $value != $this->app->encodeHtmlChars($value, ENT_NOQUOTES)
            && $this->app->getConfig('html_injection_debug', false)
        ) {
            throw $this->exception('Attempted to supply html string through append()')
                ->addMoreInfo('val', var_export($value, true))
                ->addMoreInfo('enc', var_export($this->app->encodeHtmlChars($value, ENT_NOQUOTES), true))
                //->addAction('ignore','Ignore tag'.$tag)
                ;
        }
        if ($encode) {
            $value = $this->app->encodeHtmlChars($value, ENT_NOQUOTES);
        }
        if ($this->isTopTag($tag)) {
            $this->template[] = $value;

            return $this;
        }
        if (!isset($this->tags[$tag]) || !is_array($this->tags[$tag])) {
            throw $this->exception("Cannot append to tag $tag")
                ->addMoreInfo('by', $this->owner);
        }
        foreach ($this->tags[$tag] as $key => $_) {
            if (!is_array($this->tags[$tag][$key])) {
                //throw new BaseException("Problem appending '".
                //      $this->app->encodeHtmlChars($value)."' to '$tag': key=$key");
                $this->tags[$tag][$key] = array($this->tags[$tag][$key]);
            }
            $this->tags[$tag][$key][] = $value;
        }

        return $this;
    }
public function append($tag, $value, $encode = true)
    {
        if ($value instanceof URL) {
            $value = $value->__toString();
        }
        // Temporary here until we finish testing
        if ($encode
            && $value != $this->app->encodeHtmlChars($value, ENT_NOQUOTES)
            && $this->app->getConfig('html_injection_debug', false)
        ) {
            throw $this->exception('Attempted to supply html string through append()')
                ->addMoreInfo('val', var_export($value, true))
                ->addMoreInfo('enc', var_export($this->app->encodeHtmlChars($value, ENT_NOQUOTES), true))
                //->addAction('ignore','Ignore tag'.$tag)
                ;
        }
        if ($encode) {
            $value = $this->app->encodeHtmlChars($value, ENT_NOQUOTES);
        }
        if ($this->isTopTag($tag)) {
            $this->template[] = $value;

            return $this;
        }
        if (!isset($this->tags[$tag]) || !is_array($this->tags[$tag])) {
            throw $this->exception("Cannot append to tag $tag")
                ->addMoreInfo('by', $this->owner);
        }
        foreach ($this->tags[$tag] as $key => $_) {
            if (!is_array($this->tags[$tag][$key])) {
                //throw new BaseException("Problem appending '".
                //      $this->app->encodeHtmlChars($value)."' to '$tag': key=$key");
                $this->tags[$tag][$key] = array($this->tags[$tag][$key]);
            }
            $this->tags[$tag][$key][] = $value;
        }

        return $this;
    }
public function append ( $ tag , $ value , $ encode = true ) { if ( $ value instanceof URL ) { $ value = $ value -> __toString ( ) ; } // Temporary here until we finish testing if ( $ encode && $ value != $ this -> app -> encodeHtmlChars ( $ value , ENT_NOQUOTES ) && $ this -> app -> getConfig ( 'html_injection_debug' , false ) ) { throw $ this -> exception ( 'Attempted to supply html string through append()' ) -> addMoreInfo ( 'val' , var_export ( $ value , true ) ) -> addMoreInfo ( 'enc' , var_export ( $ this -> app -> encodeHtmlChars ( $ value , ENT_NOQUOTES ) , true ) ) //->addAction('ignore','Ignore tag'.$tag) ; } if ( $ encode ) { $ value = $ this -> app -> encodeHtmlChars ( $ value , ENT_NOQUOTES ) ; } if ( $ this -> isTopTag ( $ tag ) ) { $ this -> template [ ] = $ value ; return $ this ; } if ( ! isset ( $ this -> tags [ $ tag ] ) || ! is_array ( $ this -> tags [ $ tag ] ) ) { throw $ this -> exception ( "Cannot append to tag $tag" ) -> addMoreInfo ( 'by' , $ this -> owner ) ; } foreach ( $ this -> tags [ $ tag ] as $ key => $ _ ) { if ( ! is_array ( $ this -> tags [ $ tag ] [ $ key ] ) ) { //throw new BaseException("Problem appending '". //      $this->app->encodeHtmlChars($value)."' to '$tag': key=$key"); $ this -> tags [ $ tag ] [ $ key ] = array ( $ this -> tags [ $ tag ] [ $ key ] ) ; } $ this -> tags [ $ tag ] [ $ key ] [ ] = $ value ; } return $ this ; }
This appends static content to region refered by a tag. This function
is useful when you are adding more rows to a list or table.

If tag is used for several regions inside template, they all will be
appended with new data.
This appends static content to region refered by a tag . This function is useful when you are adding more rows to a list or table .