You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/index.html.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,6 +105,14 @@ otherwise we render a template with the table provided as a parameter.
105
105
106
106
<asideclass="notice">To keep your controller thin you should <ahref="#datatable-types">make reusable DataTable types under the DataTable namespace of your app/bundle</a>.</aside>
107
107
108
+
## Controller setup
109
+
110
+
When using <code>DataTablesTrait</code> it is assumed that the <code>DataTableFactory</code> trait is available
111
+
in the controller's <code>$container</code>. When using Symfony's legacy <code>Controller</code> base class this
112
+
is true. If using <code>AbstractController</code> instead, which is currently recommended practice, ensure
113
+
you subscribe to the <code>DataTableFactory</code> service yourself. Alternatively you can bypass the convenience
114
+
trait and inject the service via regular constructor injection.
0 commit comments