<?php include "../../boot.php"; $engine = new Alchemy\Component\UI\Engine(new Alchemy\Component\UI\ReaderFactory(), new Alchemy\Component\UI\Parser()); $engine->setMetaFile("list1.yaml"); $engine->setTargetBundle("html"); $element = $engine->build(); $generated = $element->getGenerated(); echo '<link rel="stylesheet" href="//cdn.datatables.net/1.10.0-beta.2/css/jquery.dataTables.css">' . PHP_EOL; echo '<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>' . PHP_EOL; echo '<script type="text/javascript" language="javascript" src="//cdn.datatables.net/1.10.0-beta.2/js/jquery.dataTables.js"></script>' . PHP_EOL; echo '<h1>Jquery - DataTables 1.10 - Async Array Data Example</h1>'; echo $generated["html"] . PHP_EOL; echo "<script>" . $generated["js"] . "</script>";
<?php include "../../boot.php"; $engine = new Alchemy\Component\UI\Engine(new Alchemy\Component\UI\ReaderFactory(), new Alchemy\Component\UI\Parser()); $data = empty($_POST) ? array() : $_POST; $engine->setMetaFile("form2.yaml"); $engine->setTargetBundle("html"); $element = $engine->build($data); $generated = $element->getGenerated(); echo $generated["html"]; if (!empty($_POST)) { echo "<pre>"; echo "POST DATA" . PHP_EOL; print_r($_POST); }
<?php include "../../boot.php"; $engine = new Alchemy\Component\UI\Engine(new Alchemy\Component\UI\ReaderFactory(), new Alchemy\Component\UI\Parser()); $engine->setMetaFile("test1.yaml"); $engine->setTargetBundle("html"); $data = array("id" => "00000000000001", "username" => "eriknyk", "password" => "admin", "first_name" => "Erik", "last_name" => "Amaru Ortiz", "address" => "Park Avenue, N. 277.", "genre" => "M"); $_GET["mode"] = isset($_GET["mode"]) ? $_GET["mode"] : ""; $form = $engine->build($data, array("mode" => $_GET["mode"])); echo '<form action=', $form->action, '>'; echo '<table width="400">'; echo '<tr><th colspan="2">', $form->title, '</th></tr>'; echo '<tr><td colspan="2" align="center">'; foreach ($form->getToolbar() as $tbItem) { echo $tbItem->getGenerated('html') . ' '; } echo '</td><td>'; foreach ($form->getItems() as $item) { echo '<tr><td>', $item->getFieldLabel(), '</td><td>', $item->getGenerated('html'), '</td><td>'; } echo '<tr><td colspan="2" align="center">'; foreach ($form->getButtons() as $button) { echo $button->getGenerated('html') . ' '; } echo '</td><td>';
<?php include "../../boot.php"; $engine = new Alchemy\Component\UI\Engine(new Alchemy\Component\UI\ReaderFactory(), new Alchemy\Component\UI\Parser()); $data = empty($_POST) ? array() : $_POST; $engine->setMetaFile("form1.yaml"); $engine->setTargetBundle("bootstrap"); $form = $engine->build($data); ?> <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script> <div class="container"> <h1><?php echo $form->title; ?> </h1> <form role="form" class="col-sm-8 blog-main" id="<?php echo $form->getId(); ?> "<?php foreach ($form->getAttributes() as $k => $v) { echo " ", $k, '="', $v, '"'; } ?> >