Download the PHP package wizzaq/rest-bundle without Composer

On this page you can find all versions of the php package wizzaq/rest-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package rest-bundle

Wizzaq Rest Bundle

Rest bundle what you always looked for.

Usage

ProcessForm argument

Wraps typical form handling to more clean code of action.

Configuration

Simple example

Simple example of typical controller.

All options

A number of options are available on the ProcessForm attribute to control behavior:

form: string (required)

Form type class name to process


mapEntity: null|bool (default: null)

If not null, then strictly notify ProcessFormResolver use or not EntityValueResolver to resolve value before process by form.
If false, then null will be used as initial value to create form.
If null, then ProcessFormResolver will try to guess it. Can be useful if action supports create and edit at once.

:warning: We recommend you always specify this option explicitly.


submit: bool (default false)

If true, then $form->submit($data, false) (yes, with $clearMissing = false) will we used instead of default $form->handleRequest($request)


throwOnNotValid: bool (default true)

By default ProcessFormResolver throwing FormValidationException if validation failing.

Set throwOnNotValid to false if you want to process not valid form inside action.

Processed form available by


Inherited from MapEntity:

id

If an id option is configured and matches a route parameter, then the resolver will find by the primary key

mapping

Configures the properties and values to use with the findOneBy() method: the key is the route placeholder name and the value is the Doctrine property name

exclude

Configures the properties that should be used in the findOneBy() method by excluding one or more properties so that not all are used

stripNull

If true, then when findOneBy() is used, any values that are null will not be used for the query.

objectManager

By default, the EntityValueResolver uses the default object manager, but you can configure this

evictCache

If true, forces Doctrine to always fetch the entity from the database instead of cache.

disabled

If true, the ProcessFormResolver will not try to replace the argument.

resolver

By default ProcessFormResolver will be used to resolve argument, but you can configure this

How it works.

ProcessForm argument extends MapEntity and using EntityValueResolver to find existing entity exactly as described in their doc.

After ProcessFormResolver creating form with parameters:

and processing it according defined options.

If form valid it returns processed data from form.

if not, then it throws FormValidationException or returns found object if throwOnNotValid is false

Protocols

While developing an API we all have main listener to decode payload from JSON and put it back into request to process like:

or you decoding it every time in actions :thinking:

Now you can use WizzaqRestBundle to automate it by two ways:

:warning: Protocols handling enabled by default config

  1. Simple add _rest: true to route default options in config/routes.yaml:

  2. Use Rest argument. Can be applied to class or method:

Configuration options

Full configuration options:
Rest argument options

routes: null|string|array

Apply only to defined routes


protocol: ?string

Protocol name to use


responseSection: ?string

Only defined section of returned result will be used as response


responseSerializationGroups: null|string|array

Pass defined serialization groups to serializer when serialize response by protocol

Create own protocol

If you want to create you own protocol just implement Wizzaq\RestBundle\Protocol\NamedProtocolInterface and it will be tagged as protocol by autoconfiguration

Or implement Wizzaq\RestBundle\Protocol\ProtocolInterface and tag service manually with alias attribute:

Then you can disable unnecessary default protocol:

Bonus

CircularReferenceHandler

Lost CircularReferenceHandler for Symfony Serializer.


All versions of rest-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-json Version *
symfony/cache Version ^6.0
symfony/config Version ^6.0
symfony/dependency-injection Version ^6.0
symfony/framework-bundle Version ^6.0
symfony/polyfill-php81 Version 1.x-dev
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wizzaq/rest-bundle contains the following files

Loading the files please wait ...