Form.php
public static function input(string $name, string $value = '', array $attributes = null) : string
    {
        // Set the input name
        $attributes['name'] = $name;

        // Set the input id
        $attributes['id'] = (isset($attributes['id'])) ? $attributes['id'] : $name;

        // Set the input value
        $attributes['value'] = $value;

        if ( ! isset($attributes['type'])) {

            // Default type is text
            $attributes['type'] = 'text';
        }

        return '<input'.Html::attributes($attributes).'>';
    }
public static function input(string $name, string $value = '', array $attributes = null) : string
    {
        // Set the input name
        $attributes['name'] = $name;

        // Set the input id
        $attributes['id'] = (isset($attributes['id'])) ? $attributes['id'] : $name;

        // Set the input value
        $attributes['value'] = $value;

        if ( ! isset($attributes['type'])) {

            // Default type is text
            $attributes['type'] = 'text';
        }

        return '<input'.Html::attributes($attributes).'>';
    }
public static function input ( string $ name , string $ value = '' , array $ attributes = null ) : string { // Set the input name $ attributes [ 'name' ] = $ name ; // Set the input id $ attributes [ 'id' ] = ( isset ( $ attributes [ 'id' ] ) ) ? $ attributes [ 'id' ] : $ name ; // Set the input value $ attributes [ 'value' ] = $ value ; if ( ! isset ( $ attributes [ 'type' ] ) ) { // Default type is text $ attributes [ 'type' ] = 'text' ; } return '<input' . Html :: attributes ( $ attributes ) . '>' ; }
Create a form input.
Text is default input type.

echo Form::input('username', $username);

@param string $name       Input name
@param string $value      Input value
@param array  $attributes HTML attributes
@return string
Create a form input . Text is default input type .