Using HTML Placeholder in Laravel 4

前端 未结 5 1578
有刺的猬
有刺的猬 2020-12-31 01:38
{{ Form::text(\'username\', Input::old(\'username\')) }}

This is my code, I want to add Username as placeholder in the text box. I already use boot

相关标签:
5条回答
  • 2020-12-31 02:13
    {{ Form::text('username', null, array('placeholder'=>'Username' )); }}
    
    0 讨论(0)
  • 2020-12-31 02:21
    {{ Form::text('username', Input::old('username'),  array('placeholder'=>'Username')) }}
    

    This works for Laravel 4!!

    0 讨论(0)
  • 2020-12-31 02:22

    In case somebody wonders how this should work for a password field:

    {{ Form::password('password',  array('placeholder'=>'Password')) }}
    
    0 讨论(0)
  • 2020-12-31 02:30

    Been a while since this was updated but with Former for Laravel the way to do this would be:

    Former::text('field')->placeholder('langfile.path.to.placeholder.text')))
    

    The lang file would be called langfile.php with the array containing:

    <?php
    
        return array (  
            'path.to.placeholder.text' => 'Some Placeholder Text.'
        );
    
    0 讨论(0)
  • 2020-12-31 02:34

    Use:

    {{ Form::text('txtUsername', '',array('class'=>'input', 'placeholder'=>'Username')) }}
    
    0 讨论(0)
提交回复
热议问题