tag.php
public function createTag($name, $attributes)
    {
        static $map = array(
            'a'        => 'SimpleAnchorTag',
            'title'    => 'SimpleTitleTag',
            'base'     => 'SimpleBaseTag',
            'button'   => 'SimpleButtonTag',
            'textarea' => 'SimpleTextAreaTag',
            'option'   => 'SimpleOptionTag',
            'label'    => 'SimpleLabelTag',
            'form'     => 'SimpleFormTag',
            'frame'    => 'SimpleFrameTag'
        );

        $attributes = $this->keysToLowerCase($attributes);
        if (array_key_exists($name, $map)) {
            $tag_class = $map[$name];

            return new $tag_class($attributes);
        } elseif ($name === 'select') {
            return $this->createSelectionTag($attributes);
        } elseif ($name === 'input') {
            return $this->createInputTag($attributes);
        }

        return new SimpleTag($name, $attributes);
    }
public function createTag($name, $attributes)
    {
        static $map = array(
            'a'        => 'SimpleAnchorTag',
            'title'    => 'SimpleTitleTag',
            'base'     => 'SimpleBaseTag',
            'button'   => 'SimpleButtonTag',
            'textarea' => 'SimpleTextAreaTag',
            'option'   => 'SimpleOptionTag',
            'label'    => 'SimpleLabelTag',
            'form'     => 'SimpleFormTag',
            'frame'    => 'SimpleFrameTag'
        );

        $attributes = $this->keysToLowerCase($attributes);
        if (array_key_exists($name, $map)) {
            $tag_class = $map[$name];

            return new $tag_class($attributes);
        } elseif ($name === 'select') {
            return $this->createSelectionTag($attributes);
        } elseif ($name === 'input') {
            return $this->createInputTag($attributes);
        }

        return new SimpleTag($name, $attributes);
    }
public function createTag ( $ name , $ attributes ) { static $ map = array ( 'a' => 'SimpleAnchorTag' , 'title' => 'SimpleTitleTag' , 'base' => 'SimpleBaseTag' , 'button' => 'SimpleButtonTag' , 'textarea' => 'SimpleTextAreaTag' , 'option' => 'SimpleOptionTag' , 'label' => 'SimpleLabelTag' , 'form' => 'SimpleFormTag' , 'frame' => 'SimpleFrameTag' ) ; $ attributes = $ this -> keysToLowerCase ( $ attributes ) ; if ( array_key_exists ( $ name , $ map ) ) { $ tag_class = $ map [ $ name ] ; return new $ tag_class ( $ attributes ) ; } elseif ( $ name === 'select' ) { return $ this -> createSelectionTag ( $ attributes ) ; } elseif ( $ name === 'input' ) { return $ this -> createInputTag ( $ attributes ) ; } return new SimpleTag ( $ name , $ attributes ) ; }
Factory for the tag objects.
Creates the appropriate tag object for the incoming tag name and attributes.

@param string $name        HTML tag name.
@param hash $attributes    Element attributes.

@return SimpleTag          Tag object.
Factory for the tag objects . Creates the appropriate tag object for the incoming tag name and attributes .