Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
JPustkuchen committed May 15, 2021
1 parent bab0b35 commit ed0d16e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ class TsfAgDefaultController extends AbstractController
return $row;
});

return $this->render('yourTwigTemplate.twig', [
// The contained table.html.twig expects the table array structure in the key 'tabledata':
return $this->render('table.html.twig', [
'tabledata' => $tableMain->toArray(),
]);
}
Expand Down Expand Up @@ -123,7 +124,8 @@ Then you'll have to wrap the table.html.twig in a parent twig file containing th
});
</script>
{# prettier-ignore-end #}
<div id="{{ id|default('datatable')|escape('html_attr') }}-wrapper">
<div id="{{ id|default('datatable')|escape('html_attr') }}-wrapper" class="datatable-wrapper">
{% include 'table.html.twig' %}
</div>
```
In our example we additionally used a table wrapper element, for more flexibility, for example to use scrolling tables, if needed. This part is also optional.

0 comments on commit ed0d16e

Please sign in to comment.