survos / simple-datatables-bundle
incorporate simple datatables, using twig and stimulus
Fund package maintenance!
kbond
Installs: 334
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^8.1
- survos/core-bundle: ^1.5.211
- symfony/config: ^7.0 || ^6.4
- symfony/dependency-injection: ^7.0 || ^6.4
- symfony/http-kernel: ^7.0 || ^6.4
- symfony/options-resolver: ^7.0 || ^6.4
- symfony/stimulus-bundle: ^2.9
- symfony/ux-twig-component: ^2.9
- twig/twig: ^3.4
Requires (Dev)
- phpstan/phpstan: ^1.8
- roave/security-advisories: dev-latest
- symfony/browser-kit: ^7.0 || ^6.4
- symfony/framework-bundle: ^7.0 || ^6.4
- symfony/phpunit-bridge: ^7.0 || ^6.4
- symfony/twig-bundle: ^7.0 || ^6.4
- symfony/var-dumper: ^7.0 || ^6.4
Suggests
- monolog/monolog: Allows more advanced logging of the application flow
- dev-main / 1.6.x-dev
- 1.5.211
- 1.5.210
- 1.5.209
- 1.5.208
- 1.5.207
- 1.5.206
- 1.5.205
- 1.5.204
- 1.5.203
- 1.5.202
- 1.5.201
- 1.5.200
- 1.5.199
- 1.5.198
- 1.5.197
- 1.5.196
- 1.5.195
- 1.5.194
- 1.5.193
- 1.5.192
- 1.5.191
- 1.5.190
- 1.5.189
- 1.5.188
- 1.5.187
- 1.5.186
- 1.5.185
- 1.5.184
- 1.5.183
- 1.5.182
- 1.5.181
- 1.5.180
- 1.5.179
- 1.5.178
- 1.5.177
- 1.5.176
- 1.5.175
- 1.5.174
- 1.5.173
- 1.5.172
- 1.5.171
- 1.5.170
- 1.5.169
- 1.5.168
- 1.5.167
- 1.5.166
- 1.5.165
- 1.5.164
- 1.5.163
- 1.5.162
- 1.5.161
- 1.5.160
- 1.5.159
- 1.5.158
- 1.5.157
- 1.5.156
- 1.5.155
- 1.5.154
- 1.5.153
- 1.5.152
- 1.5.151
- 1.5.150
- 1.5.149
- 1.5.148
- 1.5.147
- 1.5.146
- 1.5.145
- 1.5.144
- 1.5.143
- 1.5.142
- 1.5.141
- 1.5.140
- 1.5.139
- 1.5.138
- 1.5.137
- 1.5.136
- 1.5.135
- 1.5.134
- 1.5.133
- 1.5.132
- 1.5.131
- 1.5.130
- 1.5.129
- 1.5.128
- 1.5.127
- 1.5.126
- 1.5.125
- 1.5.124
- 1.5.123
- 1.5.122
- 1.5.121
- 1.5.120
- 1.5.119
- 1.5.118
- 1.5.117
- 1.5.116
- 1.5.115
- 1.5.114
- 1.5.113
- 1.5.112
- 1.5.111
- 1.5.110
- 1.5.109
- 1.5.108
- 1.5.107
- 1.5.106
- 1.5.105
- 1.5.104
- 1.5.103
- 1.5.102
- 1.5.101
- 1.5.100
- 1.5.99
- 1.5.98
- 1.5.97
- 1.5.96
- 1.5.95
- 1.5.94
- 1.5.93
- 1.5.92
- 1.5.91
- 1.5.90
- 1.5.89
- 1.5.88
- 1.5.87
- 1.5.86
- 1.5.85
- 1.5.84
- 1.5.83
- 1.5.82
- 1.5.81
- 1.5.80
- 1.5.79
- 1.5.78
- 1.5.77
- 1.5.76
- 1.5.75
- 1.5.74
- 1.5.73
- 1.5.72
- 1.5.71
- 1.5.70
- 1.5.69
- 1.5.68
- 1.5.67
- 1.5.66
- 1.5.65
- 1.5.64
- 1.5.63
- 1.5.62
- 1.5.61
- 1.5.60
- 1.5.59
- 1.5.58
- 1.5.57
- 1.5.56
- 1.5.55
- 1.5.54
- 1.5.53
- 1.5.52
- 1.5.51
- 1.5.50
- 1.5.49
- 1.5.48
- 1.5.47
- 1.5.46
- 1.5.45
- 1.5.44
- 1.5.43
- 1.5.42
- 1.5.41
- 1.5.40
- 1.5.39
- 1.5.38
- 1.5.37
This package is auto-updated.
Last update: 2024-04-27 22:45:09 UTC
README
Integrate the Simple Datatables library from https://github.com/fiduswriter/simple-datatables/ as a stimulus component.
composer req survos/simple-datatables-bundle
Add the stimulus controller
To change any html table into a datatable, simple add the stimulus controller to the tag
<table class="table" {{ stimulus_controller('@survos/simple-datatables-bundle/table', {perPage: 5, sortable: true}) }}>
Complete Project
Cut and paste to create an new Symfony project with a dynamic, searchable datatable, without writing a single line of Javascript! No webpack or build step either.
symfony new simple-datatables-demo --webapp --version=next --php=8.2 && cd simple-datatables-demo rm .git -rf composer config extra.symfony.allow-contrib true composer req symfony/asset-mapper:^6.4 symfony/stimulus-bundle:^2.x-dev composer req survos/simple-datatables-bundle survos/bootstrap-bundle echo "import 'bootstrap/dist/css/bootstrap.min.css'" >> assets/app.js bin/console make:controller Simple -i cat > templates/simple.html.twig <<END {% extends 'base.html.twig' %} {% block body %} <table class="table" {{ stimulus_controller('@survos/simple-datatables-bundle/table', {perPage: 5, sortable: true}) }}> <thead> <tr> <th>abbr</th> <th>name</th> <th>number</th> </thead> <tbody> {% for j in 1..12 %} <tr> <td>{{ j |date('2023-' ~ j ~ '-01') |date('M') }}</td> <td>{{ j |date('2023-' ~ j ~ '-01') |date('F') }}</td> <td>{{ j }}</td> </tr> {% endfor %} </tbody> </table> {% endblock %} END symfony server:start -d symfony open:local --path=/simple