Create View in Zendframework

Lets see how we can create a view in zendframework. You can load the view by returning the new ViewModel() inside the action of a controller

You have the ProductController with following code

How does ZF know which file to be loaded?

ZF looks for view\application\product\index.phtml

So you can create that index.phtml file in that location

If you have add route and the controller to this file module\Application\config\module.config.php the you are done. If you do not know how to make route you can refer this article, also you can look for how to create controller article

You can see the following screen on http://localhost:8000/product