public function error($rule=null) {
		if($rule === null)
			return $this->self;
		elseif(isset($this->rules[$rule]))
			return $this->rules[$rule];
		elseif($attribute = $this->attribute($rule))
			return $attribute->error();
	}
public function error($rule=null) {
		if($rule === null)
			return $this->self;
		elseif(isset($this->rules[$rule]))
			return $this->rules[$rule];
		elseif($attribute = $this->attribute($rule))
			return $attribute->error();
	}
public function error ( $ rule = null ) { if ( $ rule === null ) return $ this -> self ; elseif ( isset ( $ this -> rules [ $ rule ] ) ) return $ this -> rules [ $ rule ] ; elseif ( $ attribute = $ this -> attribute ( $ rule ) ) return $ attribute -> error ( ) ; }
Return the error of a rule if provided, otherwise the main error.
@param  string $rule rule name
@return string
Return the error of a rule if provided otherwise the main error .