Tag Archives: controller

Laravel: Controller Dependency Injection

The Laravel service container is used to resolve all Laravel controllers. Hence, you are able to type-hint any dependencies that your controller may need in its constructor. Laravel automatically look for type hinted dependencies of controller constructor or controller method and if it knows how to create instance of dependencies it will do that and… Read More »

Zend Framework 2 : Call another controller action from other controller

Step 1 : Create two controllers IndexController.php and TestController.php

Step 3 : Create template show.phtml

Zend Framework 2 : Check for valid controller class, action method and template

Step 1 : Create AppController.php and extend all controllers with this controller

Step 2 : Create view files Create index.phtml in /path/to/your/app/module/Application/src/view/application/index/ Create test.phtml in /path/to/your/app/module/Application/src/view/application/index/ Step 3: Create IndexController.php