public function hidden($name, $value = null)
 {
     $hidden = new Hidden($name);
     $hidden->value($value);
     if (!is_null($value = $this->getValueFor($name))) {
         $hidden->value($value);
     }
     return $hidden;
 }
Beispiel #2
0
 public function testCanRenderWithValue()
 {
     $hidden = new Hidden('_token');
     $expected = '<input type="hidden" name="_token" value="12345">';
     $result = $hidden->value('12345')->render();
     $this->assertEquals($expected, $result);
     $hidden = new Hidden('_secret');
     $expected = '<input type="hidden" name="_secret" value="abcdefg">';
     $result = $hidden->value('abcdefg')->render();
     $this->assertEquals($expected, $result);
 }