Download the PHP package lin3s/wp-symfony-form without Composer

On this page you can find all versions of the php package lin3s/wp-symfony-form. 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 wp-symfony-form

WP Symfony Form

WordPress plugin to allow using Symfony form component with ease

SensioLabsInsight Build Status Scrutinizer Code Quality Total Downloads      Latest Stable Version Latest Unstable Version

Installation

If you are using composer run the following command:

If your composer.json is properly set up you should find this package in plugins folder

Usage

First of all, enable this plugin in the WordPress admin panel.

To create your first form extend as usual from the AbstractType class provided by Symfony component.

To enable the Ajax calls for this form you need to subscribe to the wp_symfony_form_wrappers WordPress hook.

Rendering the form

In case you want to use Twig for rendering a Bridge is provided, just run the following code line passing Twig instance

component/form.twig is your custom form theme that will be used to render the forms. Check the docs about form customization for further info.

Timber In case you are using Timber you should use twig_apply_filters hook.
Also, you have to load the form base views inside Timber global locations variable:

Important Submit event is binded to every element with .form class. In case you need to change it just do the following:

Also error container for each form item can be changed using WPSymfonyForm.formErrorsSelector.

The FormWrapper

The FormWrapper is a class designed to contain a form and all its related actions. As you've seen above a new instance is created for each form you want to use in your WordPress project, and need to be registered inside the FormWrapperRegistry.

As first parameter it receives the fully qualified namespace and as second parameter it receives an array of classes implementing Action interface.

Actions on success

In case you need to perform any server side actions, it's as easy as to implement execute method of Action interface. A form instance will to be used as desired. Check src/Action folder to check already implemented actions.

To bind this action to a specific form you need to add it in the FormWrapper.

For client side success actions you can add your callback using the global WPSymfonyForm namespace as follows:

onSuccess() and onError() are available to hook into the form.


All versions of wp-symfony-form with dependencies

PHP Build Version
Package Version
Requires php Version ^5.5 || ^7.0
symfony/config Version ^2.3 || ^3.0
symfony/finder Version ^2.3 || ^3.0
symfony/form Version ^2.8 || ^3.0
symfony/translation Version ^2.3 || ^3.0
symfony/twig-bridge Version ^2.3 || ^3.0
symfony/validator Version ^2.3 || ^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 lin3s/wp-symfony-form contains the following files

Loading the files please wait ....