Skip to content

Instantly share code, notes, and snippets.

@wdog
Created July 21, 2016 14:57
Show Gist options
  • Save wdog/8cd26442035a653aa8fb9b01df81743b to your computer and use it in GitHub Desktop.
Save wdog/8cd26442035a653aa8fb9b01df81743b to your computer and use it in GitHub Desktop.
HTML5
<?php
$form_unique_id = uniqid();
?>
<form id="form_<?= $grid->getConfig()->getName() ?>"></form>
<?php
/** @var Nayjest\Grids\DataProvider $data * */
/** @var Nayjest\Grids\Grid $grid * */
?>
<table class="table table-striped" id="<?= $grid->getConfig()->getName() ?>">
<?= $grid->header() ? $grid->header()->render() : '' ?>
<?php # ========== TABLE BODY ========== ?>
<tbody>
<?php while ($row = $data->getRow()): ?>
<?= $grid->getConfig()->getRowComponent()->setDataRow($row)->render() ?>
<?php endwhile; ?>
</tbody>
<?= $grid->footer() ? $grid->footer()->render() : '' ?>
</table>
<?php # Hidden input for submitting form by pressing enter if there are no other submits ?>
<input form="form_<?= $grid->getConfig()->getName() ?>" type="submit" style="display: none;"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment