Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • PHP Web Development with Laminas
  • Toc
  • feedback
PHP Web Development with Laminas

PHP Web Development with Laminas

By : Flavio Gomes da Silva Lisboa
4.5 (2)
close
PHP Web Development with Laminas

PHP Web Development with Laminas

4.5 (2)
By: Flavio 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 (22 chapters)
close
1
B18382_FM
Free Chapter
2
B18382_TOC_ePub
chevron up
3
B18382_Preface
4
B18382_Part1
5
B18382_01
6
B18382_02
7
B18382_03
8
B18382_04
9
B18382_Part2
10
B18382_05
11
B18382_06
12
B18382_07
13
B18382_08
14
B18382_09
15
B18382_10
16
B18382_Part3
17
B18382_11
18
B18382_12
19
B18382_13
20
B18382_14
21
B18382_Index
22
B18382_BM

Table of Contents

Preface

Part 1: Technical Background

1

Introducing Laminas for PHP Applications

Why do we need web frameworks?

Continuous integration and continuous delivery

The usefulness of a framework

From Zend Framework to Laminas

My introduction to Zend Framework

Zend Framework – the reference architecture for PHP applications

The differences between Zend Framework and Laminas

The technical and social infrastructure of the Laminas community

Summary

2

Setting Up the Environment for Our E-Commerce Application

Technical requirements

Installing Laminas

Installing Laminas through an isolated component of Laminas

Installing Laminas through an MVC skeleton application

Configuring the IDE – Eclipse for PHP developers

Integrating Laminas and Eclipse

Managing MySQL

Summary

3

Using Laminas as a Library with Test-Driven Development

Technical requirements

Understanding the requirements for developing our software

Use case – managing school classes

Implementing a structure for the use case

Creating our first automated test

Developing our use case with TDD

Creating our SchoolClassTest test class

Creating a test method in the SchoolClass class

Creating the SchoolClass class

Configuring autoloading of classes

Configuring the autoloading of test classes

Creating the config.php file and rerunning the SchoolClassTest test case

Creating a new testInserting test method

Creating an edition form edit.php

Creating a SchoolClassTest->testUpdating test method

Altering edit.php

Altering save.php

Creating the delete.php file

Generating code coverage reports

Summary

4

From Object-Relational Mapping to MVC Containers

Technical requirements

Using ORM

Use case – managing students

Implementing the use case

Running the SchoolClassTest->testListing test

Adjusting CRUD files

Using Laminas as a container

Creating the school3 project

Creating the School module

Ensuring the module has the right namespace

Implementing the test methods

Running the tests

Summary

Part 2: Creating an E-Commerce Application

5

Creating the Virtual Store Project

Technical requirements

Understanding the project requirements for the sample web application

Identifying use cases and actors

Understanding the class diagram for Whatstore

Creating the project instance

Understanding the structure of a Laminas project

Preparing the modules for our project

Summary

6

Models and Object-Relational Mappers with Behavior-Driven Development

Technical requirements

BDD with Behat

Creating our first scenario

Mapping a user story to an automated test

Creating models from user stories

Creating mappers from user stories

Adding a product to the products table

Checking whether the product was inserted

Creating a generic model and a generic mapper

Creating other models with Behat

Summary

7

Request Control and Data View

Technical requirements

Understanding the relationship between HTTP and PHP

The request life cycle in the Laminas MVC

Implementing CRUD with a controller and view pages

Testing our current test cases

Testing product insertion

Testing product recovery

Testing product updates

Testing product deletion

Creating the ProductAPIController class

Implementing the ProductController class

Implementing the pages for ProductController

Implementing the interaction between the web interface and API

Testing the interaction between the web interface and API

Summary

8

Creating Forms and Implementing Filters and Validators

Technical requirements

Generating a form for discounts with laminas-form

Creating CRUD implementation using the laminas-form component

Creating a class to define an HTML form

Filtering input data

Validating input data

Summary

9

Event-Driven Authentication

Technical requirements

Creating login and logout actions for the Inventory module

Creating tests for login and logout actions

Creating login and logout actions

Implementing the user authentication for the Inventory module

Creating the employee’s registration

Testing the login page

Verifying user identity based on events

Delegating the authentication listener to a module

Summary

10

Event-Driven Authorization

Technical requirements

Creating roles registration

Creating resources registration

Filling the resources table

Associating resources with roles

Associating roles with users

Implementing access control

Verifying users’ permissions

Modifying the test bootstrap

Creating an identity manager

Summary

Further reading

Part 3: Review and Refactoring

11

Implementing a Product Basket

Technical requirements

Managing the product inventory

Refactoring the customer home page

Controlling the product basket

Controlling the customers

Order closing

Decoupling the generic behavior of authentication

Summary

12

Reviewing and Improving Our App

Technical requirements

Principles of agile development

Eliminating duplicated code

Removing unnecessary configuration

Creating a product search box

Generating API documentation

Isolating identity management for each module

Modifying the class for identity management

Refactoring listener and controller classes

Summary

13

Tips and Tricks

Technical requirements

Creating mapped models

Customizing filters and validators

Creating a customized filter

Creating a customized validator

Understanding the Laminas view layer

Producing JSON responses with laminas-view

Uploading files with laminas-form

Changing the application layout

Mastering the controller layer

Detecting AJAX requests

Exchanging messages between the controller and view layers

Finishing controller actions

Summary

14

Last Considerations

Other Laminas components

Cache

CLI

Crypt

CSRF

DOM

Escaper

Feed

Hydrator

JSON-RPC server

LDAP

Log

Microservice-oriented development

Building APIs

Community resources

Summary

Index

Other Books You May Enjoy

bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete