Skip to content

Commit

Permalink
Add docs section about referencing the service from AbstractController
Browse files Browse the repository at this point in the history
Refs #49
  • Loading branch information
curry684 committed Nov 12, 2018
1 parent 8d52ef8 commit cd9b93e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/source/index.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ otherwise we render a template with the table provided as a parameter.

<aside class="notice">To keep your controller thin you should <a href="#datatable-types">make reusable DataTable types under the DataTable namespace of your app/bundle</a>.</aside>

## Controller setup

When using <code>DataTablesTrait</code> it is assumed that the <code>DataTableFactory</code> trait is available
in the controller's <code>$container</code>. When using Symfony's legacy <code>Controller</code> base class this
is true. If using <code>AbstractController</code> instead, which is currently recommended practice, ensure
you subscribe to the <code>DataTableFactory</code> service yourself. Alternatively you can bypass the convenience
trait and inject the service via regular constructor injection.

## Frontend code

```html
Expand Down

0 comments on commit cd9b93e

Please sign in to comment.