omines / datatables-bundle

DataTables bundle for Symfony
https://omines.github.io/datatables-bundle/
MIT License
262 stars 114 forks source link

Added TwigStringColumn for simple inline templating #146

Closed freezy-sk closed 4 years ago

freezy-sk commented 4 years ago

This column introduces simple inline templating when you don't want to use TextColumn or don't want to create template files consisting of one line of code

->add('link', TwigStringColumn::class, [
    'template' => '<a href="{{ url(\'employee.edit\', {id: row.id}) }}">{{ row.firstName }} {{ row.lastName }}</a>',
])
curry684 commented 4 years ago

I like it. Could you add a snippet to the docs as well?

curry684 commented 4 years ago

@freezy-sk I'll merge this and tag a new version when it's conflict-free and has a doc snippet 👼

freezy-sk commented 4 years ago

@curry684 docs added and PR rebased on latest master

curry684 commented 4 years ago

Awesome, thanks!