O'Reilly logo

PrestaShop Module Development by Fabien Serny

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

Chapter 5. Front Controllers, Object Models, and Overrides

Throughout the previous chapters, we wrote all the PHP code in only one class: MyModComments. This class now handles install/uninstall actions, display on the front office, process triggered by the user's actions, and module configuration in the back office. If we write a more complex module, the code would become hard to read and upgrade. Another point is that, for now, we only added a display to the existing page (for example, product page), and didn't create a new page.

In this chapter, you will learn about controllers and object models. Controllers handle the display on the front and permit us to create a new page type. Object models handle all required database requests.

We will also ...

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