Download the PHP package nstcactus/craft-contact-form-settings-module without Composer

On this page you can find all versions of the php package nstcactus/craft-contact-form-settings-module. 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 craft-contact-form-settings-module

ContactFormSettings module for Craft CMS

This module helps to manage multiple sets of settings form the Craft contact-form & contact-form-extensions plugins.

Requirements

This module requires:

Installation

  1. Install the composer module : composer require nstcactus/craft-contact-form-settings-module

  2. Add the contents of the app.php file to your config/app.php (or just copy it there if it does not exist). This ensures that your module will get loaded for each request.

    The file might look something like this:

Add a form

  1. Create a form class that extends \modules\contactFormSettings\forms\AbstractContactForm. This class will describe the settings of your form.

  2. Register this form class in the config/app.php file: add an entry in the components array of the module where the key is the form name and the value is a reference to the form class.

    Example:

  3. Add the following in the template of the form, inside the <form> element: {{ formNameInput('contact') }}

Form settings

Plugin settings override

Each form setting class must implement the getContactFormConfiguration() & getContactFormExtensionsConfiguration() methods. They expect a return value that is a settings array, just like what would be set in the config/contact-form.php & contact-form-extensions.php.

Custom validation

Custom validation rules should be defined by overriding the afterValidateSubmission() method. Here you can add validation errors on the Submission instance (available in $e->sender) like so:

``

FAQ

How do I safely let the use pick from a list of subjects?

When the subject is selected by the user in a <select> element for example, the recommended approach is

How do I set the recipient dynamically?

To set the recipient dynamically, you can either:

How do I use separate fields for first name & last name?

When using separate first & last name field as opposed to a single fromName field, make sure to actually set the fromName property of the Submission instance in the afterValidateSubmission() method.

This will improve submission index in the control panel.

Example:

``


All versions of craft-contact-form-settings-module with dependencies

PHP Build Version
Package Version
Requires nstcactus/craft-utils Version ^3.1.0 || ^4.0.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 nstcactus/craft-contact-form-settings-module contains the following files

Loading the files please wait ....