Download the PHP package nebkam/symfony-traits without Composer
On this page you can find all versions of the php package nebkam/symfony-traits. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download nebkam/symfony-traits
More information about nebkam/symfony-traits
Files in nebkam/symfony-traits
Download nebkam/symfony-traits
More information about nebkam/symfony-traits
Files in nebkam/symfony-traits
Vendor nebkam
Package symfony-traits
Short Description Helper trait to ease writing APIs in Symfony
License MIT
Package symfony-traits
Short Description Helper trait to ease writing APIs in Symfony
License MIT
Please rate this library. Is it a good library?
Informations about the package symfony-traits
Symfony Traits
Few helper traits for quicker API development in Symfony
FormTrait
handleJSONForm
- controller helper method for JSON data sent in
POST
,PUT
orPATCH
request content - generally speaking, sending JSON content is more flexible than forms, for CRUD with JS frameworks.
handleForm
- controller helper method for traditional form data in
GET
orPOST
- I advice using traditional form data only when JSON is out of place (i.e.
GET
params)
handleUpload
- controller helper method to validate a single file upload
- a lightweight alternative to a File constraint, when you need just one file, not the whole form
ValidationExceptionListener
Since all handle*
methods in this trait throw a Nebkam\SymfonyTraits\ValidationException
, you have to catch it, either via try {..} catch
in the controller or via global exception listener.
To ease this, this package includes a sample exception listener, which returns validation errors in JSON. You just have to register it as a service:
All versions of symfony-traits with dependencies
PHP Build Version
Package Version
Requires
symfony/http-foundation Version
5.* || 6.* || 7.*
symfony/http-kernel Version 5.* || 6.* || 7.*
symfony/form Version 5.* || 6.* || 7.*
symfony/validator Version 5.* || 6.* || 7.*
ext-json Version *
symfony/http-kernel Version 5.* || 6.* || 7.*
symfony/form Version 5.* || 6.* || 7.*
symfony/validator Version 5.* || 6.* || 7.*
ext-json Version *
The package nebkam/symfony-traits contains the following files
Loading the files please wait ....