public function testHorizontalFormCustomColumns() { $form = BootBuilder::openHorizontal(); $form->setLabelCol("col-md-4"); $form->setControlCol("col-md-8"); $form->add(new Text("test")); $html = $form->render(true); $this->assertContains("col-md-4", $html); $this->assertContains("col-md-8", $html); }
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css"> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <h1>Sample Form</h1> <?php require __DIR__ . '/../vendor/autoload.php'; use bootbuilder\BootBuilder; use bootbuilder\Controls\Text, bootbuilder\Controls\TextArea, bootbuilder\Controls\Button, bootbuilder\Controls\Email; use bootbuilder\Controls\Submit, bootbuilder\Controls\Checkbox, bootbuilder\Controls\File, bootbuilder\Controls\Hidden; use bootbuilder\Controls\Password, bootbuilder\Controls\Radio, bootbuilder\Controls\Select, bootbuilder\Controls\CustomHtml; $form = BootBuilder::openHorizontal(); $form->setAction(""); $form->setId("sampleform"); $form->add(new Text('sample_text', 'Testing Label', null, 'Default Value')); $txt = new Text("sample2"); $txt->setPlaceholder("Placeholder here"); $txt->setLabel("This is a placeholder test"); $email = new Email("email", "Your e-mail"); $email->setRequired(true); $area = new TextArea("sample_area"); $password = new Password("login_password", "Password"); $password->setDisabled(true); $checkb1 = new Checkbox("remember", "Remember my settings"); $checkb2 = new Checkbox("accept", "Accept our privacy policy"); $checkb2->setChecked(true); $radio1 = new Radio("envi", "Live version", "envi_live", "live");