Giter VIP home page Giter VIP logo

Comments (4)

patricktalmadge avatar patricktalmadge commented on August 17, 2024

Bootstrapper doesn't disallow a value for a password.

Bootstrapper uses the Laravel Form class to create a password input field after adding classes to the attributes array. If you look at the Laravel password function it calls the input function with a null value.

The input function uses array_merge to merge the input parameters with the attributes array so the null values takes precedence over the attributes.

I would guess this is by design because standard practice is to clear out a password field after a form submission attempt.

Functions from Laravel Form.php

/**
 * Create a HTML password input element.
 *
 * @param  string  $name
 * @param  array   $attributes
 * @return string
 */     
public static function password($name, $attributes = array())
{
    return static::input('password', $name, null, $attributes);
}

/**
 * Create a HTML input element.
 *
 * <code>
 *      // Create a "text" input element named "email"
 *      echo Form::input('text', 'email');
 *
 *      // Create an input element with a specified default value
 *      echo Form::input('text', 'email', '[email protected]');
 * </code>
 *
 * @param  string  $type
 * @param  string  $name
 * @param  mixed   $value
 * @param  array   $attributes
 * @return string
 */     
public static function input($type, $name, $value = null, $attributes = array())
{
    $name = (isset($attributes['name'])) ? $attributes['name'] : $name;

    $id = static::id($name, $attributes);

    $attributes = array_merge($attributes, compact('type', 'name', 'value', 'id'));

    return '<input'.HTML::attributes($attributes).'>';
}

from bootstrapper.

Geczy avatar Geczy commented on August 17, 2024

Except it's not just a password field, it's any field..

from bootstrapper.

patricktalmadge avatar patricktalmadge commented on August 17, 2024

It's the same idea. You are passing in an empty string to the text field which calls the Laravel Form text function after adding the bootstrap classes and then calls the Laravel input function. It than merges the empty string over the top of your attributes array. If you want to pass a value try this:

from bootstrapper.

Geczy avatar Geczy commented on August 17, 2024

Ah, there we go. Thanks! So password doesn't accept a value by default for 'security purposes'

from bootstrapper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.