Book Image

PHP Web Development with Laminas

By : Flávio Gomes da Silva Lisboa
4.5 (2)
Book Image

PHP Web Development with Laminas

4.5 (2)
By: Flávio Gomes da Silva Lisboa

Overview of this book

Considered the next generation of the Zend framework, Laminas is a high-performance PHP framework for creating powerful web applications with an evolutive architecture. This book takes a hands-on approach to equip you with the knowledge of the Laminas framework necessary to start building web applications based on the reuse of loosely coupled components. You'll learn how to create the basic structure of a PHP web application divided into layers, understand Laminas’ MVC components, and be able to take advantage of the Eclipse platform as a method for developing with Laminas. Step by step, you'll build an e-commerce application based on the technical requirements of a fictional business, and get to grips with implementing those requirements using Laminas components. By the end of this web development book, you’ll be able to build a completely secured MVC application in PHP language using Laminas.
Table of Contents (20 chapters)
1
Part 1: Technical Background
6
Part 2: Creating an E-Commerce Application
13
Part 3: Review and Refactoring

Generating a form for discounts with laminas-form

In this chapter, we will use three new Laminas components. The first is laminas-form, used to define HTML forms. In the same way you added and installed the laminas-db component using Composer, do the same for the laminas-form component:

  1. Open the composer.json file in Eclipse.
  2. Through the Dependencies tab, search for the laminas/laminas-form package and add it.
  3. Save the file and click on the Update dependencies button.

If you have any doubts about how to install Composer dependencies with Eclipse, read the Creating our first automated test section of Chapter 3, Using Laminas as a Library with Test-Driven Development.

Important note: Component injection into configuration

When you install a Laminas component in an MVC Laminas project with Composer, you will be asked about the injection of a component into configuration. When Composer asks this, you must select the option to inject into the config/modules...