Function: input_password()

function input_password(array $parameters, bool $echo = true): string|null;

Function for rendering the password input field.

Details

This function renders a password input field that is bound to the request variable with the corresponding name.

Parameters

Name Pass type Value type Default value Description
$parameters by value array

The array of parameters as an associative array in the form key => value:

  • $parameters["id"] - id of the field.

  • $parameters["name"] - name of the field.

Any other attributes may be specified.

Example:

input_password(["id" => "data_input_password",
                "name" => "data[input_password]",
                "class" => "my_class",
                "style" => "width: 300px",
                "placeholder" => "enter the password",
                "title" => "enter the password",
                "data-prop" => "some-prop"
               ]);
$echo by value bool true

If the value of $echo is true, the html code of the field is directly echoed. Otherwise it is returned as string. It might be useful to pass this code to other rendering functions instead of echoing.

Returns

string|null

If the paramter $echo is true, the string of the field html code is returned, otherwise null.

Authors

Oleg Schildt

Package

Source code

See also