Boostrap::openDiv($attribute); // column open ///////////////////////////////////// $attribute = array('class' => $isBoostrap ? 'form-horizontal' : '', 'action' => 'test.php'); // $buffer .= 'header("Cache-Control: public")'; // $buffer .= 'header("Content-Description: File Transfer")'; // $buffer .= 'header("Content-Disposition: attachment; filename='.$pageName.'.html")'; // $buffer .= 'header("Content-Type: application/octet-stream; ")'; // $buffer .= 'header("Content-Transfer-Encoding: binary")'; $buffer .= Boostrap::openForm($pageName, $attribute); echo Boostrap::openForm($pageName, $attribute); // echo $db->getLastPage(); $buffer .= $code; echo $code; $buffer .= Boostrap::closeForm(); echo Element::buttonLink("download Code", "index.php?download=true"); echo Boostrap::closeForm(); ///////////////////////////////// if (isset($_GET['download']) && $_GET['download'] == true) { Log::writeFile($pageName, $buffer); } ///////////////////////////////// $attribute = array('class' => $isBoostrap ? 'form-horizontal' : '', 'action' => 'index.php', 'id' => 'name'); echo Boostrap::openForm("Create a new form", $attribute); echo str_replace('{text}', 'Form Name', Element::text(array('label' => 'Form Name', 'placeholder' => '', 'help' => ''), 'textinput', false)); echo Element::button("New"); echo Boostrap::closeForm(); ////////////////////////////// // open form $attribute = array('class' => $isBoostrap ? 'form-horizontal' : '', 'action' => 'index.php'); echo Boostrap::openForm("Add elements to form", $attribute);
function getElement($id, $name, $link, $options) { $element = ''; switch ($id) { case 105: return Element::text(array('label' => $name, 'placeholder' => '')); case 106: return Element::button($name); case 107: return Element::buttonLink($name, $link); case 108: return Element::radioButton($name, $options); case 109: return Element::checkBox($name, $options); case 110: return Element::dropdownList($name, $options); } }
<?php /** * Created by IntelliJ IDEA. * User: Roledene * Date: 2/10/2016 * Time: 6:33 PM */ include 'app/Database.php'; include 'app/Element.php'; $db = new \app\Database(); $db->deleteAllElements(); $db->insertElement("textBox", \app\Element::text(array('label' => 'Tex Box', 'placeholder' => 'text', 'help' => 'help', 'require' => false), true, false), 0); $db->insertElement("button", \app\Element::button("Button"), 0); $db->insertElement("link", \app\Element::buttonLink("Button", "add.php"), 0); $db->insertElement("RadioButton", \app\Element::radioButton("Radiobtn", array(0 => 'radio 1')), 0); $db->insertElement("CheckBox", \app\Element::checkBox("Check", array(0 => 'check 1', 1 => 'check 2')), 0); $db->insertElement("Dropdown", \app\Element::dropdownList("Drop", array(0 => 'op 1', 1 => 'op 2', 2 => 'op 3')), 0);