cerad / routing

7 stars 0 forks source link

Using Autowiring with your routing #1

Open Bjoern3003 opened 4 years ago

Bjoern3003 commented 4 years ago

Hi,

you example is very well and working fine.

Can you maybe extend your example with a new method, using autowiring (for example pass the request class).

If I extend the DefaultController class with AbstractController, I get a Fatal Error Uncaught Doctrine\Common\Annotations\AnnotationException: [Semantical Error] The annotation "@required" in method Symfony\Bundle\FrameworkBundle\Controller\AbstractController::setContainer() was never imported

Maybe you have an Idea or an Example for me. Thank you.

ahundiak commented 4 years ago

Autowire is challenging without a container. Humor. The example shows how to use annotation based routing outside of the Symfony framework. If you want things like autowire then use the actual framework.