Validation in ZF1

For programming and general questions on Zend Framework
Post Reply
rosh9277
Posts: 1
Joined: Thu Jun 15, 2017 8:34 am

Validation in ZF1

Post by rosh9277 » Thu Jun 15, 2017 8:35 am

I have injected a service layer in Zend Framework 1 project. The project also has REST API for android and other devices. My project layout looks like this

Code: Select all

Application 
 modules
      default
         controller
             CustomerController.php [for web]
      api
         controllers
              CustomerController.php [for android device]
 services
   CustomerService.php
While CustomerService.php class handles all customer creation logic and is consumed by CustomerController.php in both api and default module. Its easy to validate the values submitted by users in web using form. How can I validate the values submitted by users in service so that there is no code repetition in both front and api controllers for validation?

Post Reply