Commit 7bccd90c authored by lauriii's avatar lauriii

Issue #2938743 by Manuel Garcia: Document #pattern property for email,...

Issue #2938743 by Manuel Garcia: Document #pattern property for email, password, tel, textfield, and url form elements
parent 802d1e4f
......@@ -11,12 +11,14 @@
* Properties:
* - #default_value: An RFC-compliant email address.
* - #size: The size of the input element in characters.
* - #pattern: A string for the native HTML5 pattern attribute.
*
* Example usage:
* @code
* $form['email'] = array(
* '#type' => 'email',
* '#title' => $this->t('Email'),
* '#pattern' => '*@example.com',
* );
* @end
*
......
......@@ -10,6 +10,7 @@
*
* Properties:
* - #size: The size of the input element in characters.
* - #pattern: A string for the native HTML5 pattern attribute.
*
* Usage example:
* @code
......@@ -17,6 +18,7 @@
* '#type' => 'password',
* '#title' => $this->t('Password'),
* '#size' => 25,
* '#pattern' => '[01]+',
* );
* @endcode
*
......
......@@ -12,12 +12,14 @@
*
* Properties:
* - #size: The size of the input element in characters.
* - #pattern: A string for the native HTML5 pattern attribute.
*
* Usage example:
* @code
* $form['phone'] = array(
* '#type' => 'tel',
* '#title' => $this->t('Phone'),
* '#pattern' => '[^\d]*',
* );
* @endcode
*
......
......@@ -15,6 +15,7 @@
* autocomplete JavaScript library.
* - #autocomplete_route_parameters: An array of parameters to be used in
* conjunction with the route name.
* - #pattern: A string for the native HTML5 pattern attribute.
*
* Usage example:
* @code
......@@ -24,7 +25,8 @@
* '#default_value' => $node->title,
* '#size' => 60,
* '#maxlength' => 128,
* '#required' => TRUE,
* '#pattern' => 'some-prefix-[a-z]+',
* '#required' => TRUE,
* );
* @endcode
*
......
......@@ -12,6 +12,7 @@
* Properties:
* - #default_value: A valid URL string.
* - #size: The size of the input element in characters.
* - #pattern: A string for the native HTML5 pattern attribute.
*
* Usage example:
* @code
......@@ -19,6 +20,7 @@
* '#type' => 'url',
* '#title' => $this->t('Home Page'),
* '#size' => 30,
* '#pattern' => '*.example.com',
* ...
* );
* @endcode
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment