Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
PHP Web Development with Laminas

You're reading from   PHP Web Development with Laminas Build a fully secured and functional e-commerce application with PHP using the Laminas framework

Arrow left icon
Product type Paperback
Published in Nov 2022
Publisher Packt
ISBN-13 9781803245362
Length 394 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Flavio Gomes da Silva Lisboa Flavio Gomes da Silva Lisboa
Author Profile Icon Flavio Gomes da Silva Lisboa
Flavio Gomes da Silva Lisboa
Arrow right icon
View More author details
Toc

Table of Contents (22) Chapters Close

1. B18382_FM
2. B18382_TOC_ePub FREE CHAPTER
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

8

Creating Forms and Implementing Filters and Validators

This chapter will introduce some Laminas components to handle data input. In this chapter, you will learn how to connect the model layer with the view layer in a controller using laminas-form, how to filter input data with laminas-filter, and how to apply validation rules with laminas-validator.

In this chapter, we’ll be covering the following topics:

  • Generating a form for discounts with laminas-form
  • Filtering input data
  • Validating input data

At the end of this chapter, you will be able to define HTML forms programmatically using the laminas-form component. You will also know how to convert input data and remove unwanted (and possibly dangerous) content using the laminas-filter component. Finally, you will also discover how to validate input data before saving it into a database using the laminas-validator component.

Technical requirements

All the code related to this chapter can be...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime