<?php

class Tag_Option extends Tag
{
	public function __construct($value='', $label=NULL, $attributes=array())
	{
		parent::__construct('option', $attributes, TAG_CLOSE);
		$this->attr('value', $value);
		if( !is_null($label) )
			$this->text($label);
		else
			$this->text($value);
	}

	public function value($value=NULL)
	{
		return $this->attr('value', $value);
	}

	public function selected($selected=NULL)
	{
		return $this->attr('selected', ($selected?'selected':NULL) );
	}
}
