Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe CssIdentifierRule
+ Graphe d'héritage de CssIdentifierRule:

Fonctions membres publiques

 test (\SimpleXMLElement $element, $value, $group=null, Registry $input=null, Form $form=null)
 
- Fonctions membres publiques hérités de FormRule
 test (\SimpleXMLElement $element, $value, $group=null, Registry $input=null, Form $form=null)
 

Membres hérités additionnels

- Attributs protégés hérités de FormRule
 $regex
 
 $modifiers = ''
 

Description détaillée

Form Rule class for the Joomla Platform.

Depuis
4.0.0

Documentation des fonctions membres

◆ test()

test ( \SimpleXMLElement  $element,
  $value,
  $group = null,
Registry  $input = null,
Form  $form = null 
)

Method to test if the file path is valid

Paramètres
\SimpleXMLElement$elementThe SimpleXMLElement object representing the <field> tag for the form field object.
mixed$valueThe form field value to validate.
string$groupThe field name group control value. This acts as an array container for the field. For example if the field has name="foo" and the group value is set to "bar" then the full field name would end up being "bar[foo]".
Registry$inputAn optional Registry object with the entire data set to validate against the entire form.
Form$formThe form object for which the field is being tested.
Renvoie
boolean True if the value is valid, false otherwise.
Depuis
4.0.0

The following regex rules are based on the Html::cleanCssIdentifier method from Drupal https://github.com/drupal/drupal/blob/8.8.5/core/lib/Drupal/Component/Utility/Html.php#L116-L130

with the addition for Joomla that we allow the colon (U+003A).

Valid characters in a CSS identifier are:

  • the hyphen (U+002D)
  • a-z (U+0030 - U+0039)
  • A-Z (U+0041 - U+005A)
  • the underscore (U+005F)
  • the colon (U+003A)
  • 0-9 (U+0061 - U+007A)
  • ISO 10646 characters U+00A1 and higher

Full identifiers cannot start with a digit, two hyphens, or a hyphen followed by a digit.

Références $i, $required, et $value.


La documentation de cette classe a été générée à partir du fichier suivant :