Exemplo n.º 1
0
 /**
  * @dataProvider booleanProvider
  */
 public function testBoolean($value, $checked)
 {
     $input = Builder::checkbox();
     $input->val($value);
     if ($checked) {
         $this->assertTrue($input->attr('checked'));
     } else {
         $this->assertNotTrue($input->attr('checked'));
     }
     $input->load($value);
     if ($checked) {
         $this->assertTrue($input->attr('checked'));
     } else {
         $this->assertNotTrue($input->attr('checked'));
     }
 }
Exemplo n.º 2
0
 public function __construct()
 {
     return $this->method('post')->add(['id' => B::hidden(), '_processor' => B::hidden()->value('edit'), 'name' => B::text()->required()->attr(['placeholder' => __('Name')]), 'user' => B::text()->required()->attr(['placeholder' => __('User')]), 'password' => B::password()->attr(['placeholder' => __('Password')]), 'password_repeat' => B::password()->attr(['placeholder' => __('Repeat Password')]), 'admin' => B::checkbox()->attr(['placeholder' => __('Admin'), 'value' => '1']), 'enabled' => B::checkbox()->attr(['placeholder' => __('Enabled'), 'value' => '1'])])->setRender('Bootstrap');
 }
Exemplo n.º 3
0
 public function __construct()
 {
     return $this->method('post')->add(['_processor' => B::hidden()->val('login'), 'user' => B::text()->attr(['placeholder' => __('Tu usuario'), 'autofocus' => true, 'required' => true]), 'password' => B::password()->attr(['placeholder' => __('Tu contraseña'), 'required' => true]), 'remember' => B::checkbox()->attr(['placeholder' => __('Recuérdame'), 'value' => '1'])])->setRender('Bootstrap');
 }