Hot answers tagged

2

In Drupal 8, routes and hooks have different purposes. Routes are for rendering a page containing information, while hooks are used to react to an event or to alter the information returned from other modules. I assume you need to show information, and a controller is really what you need. (The rest of the answer will consider the case you really need a ...


2

The problem here is that controllers are specifically intended to return a result based on a given path. The result you want isn't dependent on a path, but rather on an operation performed on an entity. What you'll want to use instead is one of the entity API hooks, found here: Entity CRUD, editing and view hooks To respond to your entity being created, I ...


Only top voted, non community-wiki answers of a minimum length are eligible