Comments (4)
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.
Except it's not just a password field, it's any field..
from bootstrapper.
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.
Ah, there we go. Thanks! So password doesn't accept a value by default for 'security purposes'
from bootstrapper.
Related Issues (20)
- Protected vs private in service provider HOT 4
- 'Active' Class on Navbar Links HOT 9
- Upgrade Guide? HOT 3
- Specify data attributes (or other) on Button? HOT 2
- Laravel5 bug HOT 6
- Alternative alias configuration.. HOT 1
- Can't add HTML to a panel body HOT 2
- dependency on "illuminate/html": "~4.2||~5", HOT 2
- How do I create input group using the InputGroup Facade in Laravel 5 ? HOT 3
- Laravel 5.4 : Call to undefined method Illuminate\Session\Store::getToken() HOT 11
- Update to laravelcollective/html changes Select function parameters in Form.php [fix found] HOT 2
- How can I use bootstrapper inside Laravel 5 controllers?
- Error on blade files using bootstrapper on phpstorm HOT 1
- Bootstrap 4 support in the future? HOT 1
- Automatic Use Of repo without add Providers and aliases in Laravel >5.5
- bootstrap 4 is now released HOT 2
- Facade 'Icon' => Bootstrapper\Facades\Icon::class doesn't get glyphicon in Bootstrap 4
- Declaration of Bootstrapper\Form::select.....should be compatible with Collective\Html\FormBuilder::select
- blank page HOT 2
- Laravel 6 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bootstrapper.