'my-special-class', 'name' => 'my-element-name' ) **/ public function __construct( $attrs = null ) { $this->attrs = $attrs; } /** * Displays this input.. * @param array $attr_overrides * Associative array - the key is the attribute name and the value is the value of that attribute; * note that the keys in this array will overwrite the keys in the array that was setup at construction.. * @param boolean $echo Set to 'true' to echo the markup or 'false' to only return it */ public function display( $attr_overrides = null, $echo = true ) { // Merge the two attribute arrays.. if ( !empty( $attr_overrides ) ) { $this->attrs = array_merge( $this->attrs, $attr_overrides ); } // Create the 'input' element with the given attributes.. $markup = 'attrs as $key => $value ) { $markup .= sprintf( ' %s="%s"', $key, $value ); } $markup .= '>'; $markup .= ''; // If desired, echo directly in here.. if ( $echo ) { echo $markup; } // Always return the markup.. return $markup; } /* PRIVATE */ private $attrs = null; } ?>