Download the PHP package heimrichhannot/contao-formhybrid without Composer

On this page you can find all versions of the php package heimrichhannot/contao-formhybrid. 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 contao-formhybrid

Formhybrid

Contains functionality for handling form submissions in the contao frontend.

Usage is simple: Include the default palette (_FORMHYBRID_PALETTEDEFAULT) in config.php into your module's tl_module file and remove the fields you don't need for your module.

-> Click submissions.

Features

Usage

Install

With composer and Contao 4 Managed Edition:

Palette handling

Inserttags

Developers

Notification center tokens

Formhybrid is notification center ready. It is possible to send 2 E-Mails on Form Submission to the sender (confirmation notification) and one to receiver (submission notification). The following tokens are provided for usage:

Tag Example Description
##formsubmission_all## Firstname: Max\ Contains the complete submission (contains also hidden form values like tstamp) formated as label and value.
Lastname: Mustermann\
Zeitstempel: 1458030977
##formsubmission## Firstname: Max\ Contains the complete submission (without hidden fields) formatted as label and value.
Lastname: Mustermann
##formsubmission*## ##form_submission_country## -> Country: Germany Contains the submission of a single field formatted as label and value (value takes options into consideration and return its corresponding value).
##formvalue*## ##form_value_country## -> de Contains submitted value of a field (no value is transformed by its reference).
##formplain*## Input:

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.

\
Strips html entities from the submitted value (helpful for plain text e-mails and tinymce textareas)
Output: -> ##form_value_text## -> Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
##form_*## ##form_county## -> Germany Contains the formatted value of the submission (value takes options into consideration and return its corresponding value).
##opt_in_token## ##opt_in_token## -> [TOKEN] / Generates only the opt-in the token.
##opt_in_link## ##opt_in_link## -> http://mywebsite.com/linkto-form?token=[TOKEN] Generates the opt-in activation link.

Config Callbacks

Type Description
onload_callback Add a 3rd parameter with boolean true to your onload_callbacks to run through them in frontend mode.

Additional eval dca config parameters

Key Default Example Description
allowedTags null

Allow specific html tags inside input that will not be escaped (allowHtml must be true). allowHtml will be true by default if preserveTags, rte is set true within eval config.

Frontend Form

We recommend to use Contao Frontendedit. If you can't or need more advanced options:

More advanced configurations can be archived by extending the Form class and overwrite methods. Following methods are availiable to overwrite (no complete list, see Form and DC_Hybrid classes):

Method Description
abstract void compile() Called before rendering the form. Must be implementet.
void onSubmitCallback(\DataContainer $dc) Called after submitting the form, before writing to the database and sending confirmations).
void onUpdateCallback($objItem, \DataContainer $objDc, $blnJustCreated, $arrOriginalRow = null) Called after submit, if data record already exist.
void afterSubmitCallback(\DataContainer $dc) Called after submitting the form and after saving enitity and sending confirmations.
void afterActivationCallback(\DataContainer $dc) Called after successful opt in.
void afterUnsubscribeCallback(\DataContainer $dc) Called after successful opt out.
bool sendOptInNotification(\NotificationCenter\Model\Message $objMessage, $arrSubmissionData, $arrToken) Default: true
bool sendSubmissionNotification(\NotificationCenter\Model\Message $objMessage, &$arrSubmissionData, &$arrToken) Default: true
bool sendSubmissionEmail($objEmail, &$arrRecipient, &$arrSubmissionData) Default: true
void onSendSubmissionEmailCallback($objEmail, $arrRecipient, $arrSubmissionData) Called in sendSubmissionEmail()
bool sendConfirmationNotification(\NotificationCenter\Model\Message $objMessage, &$arrSubmissionData, &$arrToken) Default: true
bool sendConfirmationEmail($objEmail, &$arrRecipient, &$arrSubmissionData) Default: true

Hooks

Name Parameter Description
formhybridBeforeCreateNotifications array &$submissionData, Form $currentForm Do custom logic before sending notification. You can manipulate the submission data or send custom notifications.
formhybridOnCreateInstance Form $form, $varConfig = null, $id = 0 Is called in the form constructor and allows to change configs or do actions on every form init.
formhybridBeforeCreateWidget FormhybridBeforeCreateWidgetEvent $event Is called before widget class constructor is called. You can change widget config and widget class in the event class.
formhybridBeforeRenderForm FormhybridBeforeRenderFormEvent $event Is called before the form template is rendered and can be used to modify data or work with the data before rendering.
formhybridModifyAsyncFormSubmitResponse FormhybridModifyAsyncFormSubmitResponseEvent $event Modify the response data before returning the form ajax response.

JavaScript Events

Event Descripiton
formhybrid_ajax_complete Dispatched after successful async form submit
formhybridToggleSubpaletteComplete Dispatched after subpalette toggled

Opt in handling

FormHybrid comes with build in opt-in handling. Following steps are required to use it:

Opt out handling

FormHybrid comes with build in opt-out handling. After calling the opt-out link the entity will be deleted. Following steps are required to use it:

Attention: If you enhance already existing data with opt-out-handling, tokens are not automatically generated for existing entries and unsubscription is not possible for existing entries! You need to check if the entry already has an token in your code, before generating opt-out link! Example:

Dublicate entity flag

Set Form::isDuplicateEntityError to true, to stop before saving and throw error message.

Customization

Add custom submit label

Add your label to $GLOBALS['TL_LANG']['MSC']['formhybrid']['submitLabels'].


All versions of contao-formhybrid with dependencies

PHP Build Version
Package Version
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 heimrichhannot/contao-formhybrid contains the following files

Loading the files please wait ....