I didn’t find a solution online, so I implemented it myself based on phalcon’s request objectgetPatch()和hasPatch().
Specific usage:
// get all patch data...
$params = $this->request->getPatch();
// try to get username from patch data
$name = $this->request->getPatch('username');
// try to get and format price
$price = $this->request->getPatch('price', 'float!');
You only need to inject your own Request class into the dependency to call the getPatch() method in the project
$di->set('request', function() {
return new \Request();
}, true);
I didn’t find a solution online, so I implemented it myself based on phalcon’s request object
getPatch()
和hasPatch()
.Specific usage:
You only need to inject your own Request class into the dependency to call the getPatch() method in the project
The specific code is on Github:
https://github.com/baohanddd/...