code: public function setRequired($flag){
  		$this->tags['required']=$flag;
  		if($this->validator){
  			$this->validator->setOption('empty',!$flag);
  		}
  	}
docs: Set html tag required
  
  @param bool $flag - if true then required else optional