Download the PHP package contenir/contenir-formbuilder-mezzio without Composer

On this page you can find all versions of the php package contenir/contenir-formbuilder-mezzio. 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 contenir-formbuilder-mezzio

contenir/contenir-formbuilder-mezzio

Continuous Integration codecov

Mezzio adapter for contenir/contenir-formbuilder, for Mezzio sites that use Contenir forms without running the full CMS. It is the Mezzio counterpart of contenir/contenir-formbuilder-laminas-mvc, with the same features expressed with Mezzio plumbing:

Requirements

Installation

The current release, 2.0.0-RC1, is a release candidate. The database layer uses php-db/phpdb 0.6, which is still a dev branch (contenir-db-model 2.0.0-rc2 depends on it too). Composer only honours stability flags in the root composer.json, so your site has to allow both itself:

Alternatively, set "minimum-stability": "dev", "prefer-stable": true in your root composer.json and require contenir/contenir-formbuilder-mezzio as usual. 2.0.0 final follows once php-db 0.6.0 is tagged.

With laminas-component-installer the Contenir\FormBuilder\Mezzio\ConfigProvider is added to config/config.php; without it, add the provider yourself.

Then make sure the session middleware runs before routing, as Mezzio sites that use sessions do:

and register the services the package needs:

Service Purpose
PhpDb\Adapter\AdapterInterface (or the id in formbuilder.db_adapter) Forms schema and entries
Mezzio\Session\SessionPersistenceInterface Sessions, for CSRF and the error stash
Symfony\Component\Mailer\MailerInterface Optional: enables email notifications
Contenir\Storage\StorageManager Optional: enables file fields
Psr\Log\LoggerInterface Optional: email and webhook failures are logged
Psr\Clock\ClockInterface Optional: entry timestamps (the system clock otherwise)

The submit route is registered for you at POST /forms/submit/{slug}, named formbuilder.submit.

Usage

Render a form on a page from your own handler:

$form is the form, wrapped in <div class="formbuilder" id="formbuilder-contact">, or its success message after a successful submission. For your own markup use FormPresenter::present(), which returns the definition, the built and hydrated Laminas form and its rendered HTML. See Rendering.

The form posts to the submit route, which answers with a redirect back to the page (or JSON for Accept: application/json). See Submitting.

Class Purpose
Handler\SubmitHandler The PSR-15 submit endpoint
Handler\SubmissionPipeline One submission through the core FormSubmissionService: CSRF, uploads, observers
Render\FormPresenter Load, build (with the session's CSRF token), hydrate from the stash, render
Render\FormBlockRenderer FormPresenter plus the formbuilder::form template
Render\PresentedForm What the presenter returns
Loader\FormLoaderInterface, Loader\PhpDbFormLoader Form definitions
Repository\EntryRepositoryInterface, Repository\PhpDbEntryRepository Entry storage
Registrar\StoreSubmissionRegistrar, Registrar\EmailNotificationRegistrar Submission observers
Csrf\CsrfTokenManager, Csrf\CsrfFormFactory, Csrf\SessionCsrfFormBuilder, Csrf\CsrfElement, Csrf\CsrfTokenValidator Session CSRF tokens
State\FormStateStash One-shot stash of an invalid submission's values and errors
Http\UploadedFileStager, Http\StagedUploads PSR-7 uploads for the core service
Http\Responder PSR-17 JSON and redirect responses
Token\TokenReplacerBuilder Merge-tag replacers with the configured {site:*} values and namespaces
Route\SubmitRouteDelegator Registers the submit route on Mezzio\Application
ConfigProvider and the Factory\* classes Container wiring
Page Covers
Configuration The formbuilder keys, services and the submit route
Loading forms PhpDbFormLoader and the schema
Submitting SubmitHandler, responses, success modes, CSRF, the stash, uploads
Rendering FormPresenter, FormBlockRenderer and the formbuilder::form template
Registrars Entry storage, email notifications, webhooks, your own observers
Coming from laminas-mvc Each laminas-mvc adapter feature and config key, and its Mezzio equivalent

Security

See Submitting for the details.

Development

The QA toolchain is contenir/contenir-qa-tools. Mago is a standalone binary, installed separately (brew install mago).

License

MIT. See LICENSE.


All versions of contenir-formbuilder-mezzio with dependencies

PHP Build Version
Package Version
Requires php Version ~8.3.0 || ~8.4.0 || ~8.5.0
contenir/contenir-formbuilder Version ^2.0
laminas/laminas-form Version ^3.20
laminas/laminas-inputfilter Version ^2.30
laminas/laminas-validator Version ^2.50 || ^3.0
mezzio/mezzio Version ^3.18
mezzio/mezzio-router Version ^3.17
mezzio/mezzio-session Version ^1.15
mezzio/mezzio-template Version ^2.10
php-db/phpdb Version ^0.6.0
psr/clock Version ^1.0
psr/container Version ^1.1 || ^2.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.1 || ^2.0
psr/http-server-handler Version ^1.0.2
psr/http-server-middleware Version ^1.0.2
psr/log Version ^1.0 || ^2.0 || ^3.0
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 contenir/contenir-formbuilder-mezzio contains the following files

Loading the files please wait ...