public static method

Returns a list of available validation rules, or the configuration details of a single rule.


  • string $name

    Optional name of a rule to get the details of. If not specified, an array of all available rule names is returned. Otherwise, returns the details of a single rule. This can be a regular expression string, a closure object, or an array of available rule formats made up of string regular expressions, closures, or both.



Returns either an single array of rule names, or the details of a single rule.


	public static function rules($name = null) {
		if (!$name) {
			return array_keys(static::$_rules);
		return isset(static::$_rules[$name]) ? static::$_rules[$name] : null;