Are you interested in purchasing the entire website? If so, we will include an additional premium domain (freetimelearn.com) at no extra cost along with this domain.
Mail : freetimelearn@gmail.com
WhatsApp : +919966463846
{Controller name}Controller; note that {Controller name} must start with a capital letter. This class lives in a file called {Controller name}Controller.php within the Controller subdirectory for the module; in our case that is module/Album/src/Controller/. Each action is a public method within the controller class that is named {action name}Action, where {action name} should start with a lower case letter.Zend\Stdlib\Dispatchable interface. The framework provides two abstract classes that do this for us: Zend\Mvc\Controller\AbstractActionController and Zend\Mvc\Controller\AbstractRestfulController. We'll be using the standard AbstractActionController, but if you’re intending to write a RESTful web service, AbstractRestfulController may be useful.zf-tutorials/module/Album/src/Controller/AlbumController.php :namespace Album\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
class AlbumController extends AbstractActionController
{
public function indexAction()
{
}
public function addAction()
{
}
public function editAction()
{
}
public function deleteAction()
{
}
}
| URL | Method called |
|---|---|
http://zf-tutorial.localhost/album |
Album\Controller\AlbumController::indexAction |
http://zf-tutorial.localhost/album/add |
Album\Controller\AlbumController::addAction |
http://zf-tutorial.localhost/album/edit |
Album\Controller\AlbumController::editAction |
http://zf-tutorial.localhost/album/delete |
Album\Controller\AlbumController::deleteAction |