Ejemplo n.º 1
0
<?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>';
Ejemplo n.º 2
0
<?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>";
Ejemplo n.º 3
0
<?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);
}