The controller
keyword in a template is inherited from the containing template unless it overrides it.
Consider this template for the index route.
If posts is an array but not an array controller then {{controller}}
will be the ambient controller, IndexController
.
If posts is an array controller, PostsController
, and does not define an item controller then {{controller}}
will be PostsController
.
If posts is an array controller and it defines an item controller, PostController
, then {{controller}}
will be PostController
.