O'Reilly logo

Zend Framework 2 Cookbook by Josephus Callaars

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using modules as a widget

Widgetizing is a great method to use modules on different places in our applications. That's why this recipe will explain everything we need to know about doing this in the best way possible.

Getting ready

A working Zend Framework 2 skeleton application is needed to make full use of this recipe.

How to do it…

Widgets, they even sound great! We will explain in this recipe what they do and how they can be used.

Creating the Comment/Controller/Index

We will create a small controller that will return some example comments, which are static and hardcoded for example only. First we should make sure we have a Comment module, so we create the following directories and files:

module/ Comment/ config/ module.config.php src/ Comment/ Controller/ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required