Download the PHP package dolphiq/craft3-forms without Composer

On this page you can find all versions of the php package dolphiq/craft3-forms. 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 craft3-forms

Form plugin for Craft CMS 3.x

Currently the project is DISCONTINUED. However, feel free to fork it and continue its development!

Craft CMS 3 is build on top of the Yii 2 Framework. This plugin makes it possible to use forms the way the Yii 2 Framework offers. This includes:

Next to this Yii 2 Framework logic, we added:

Note: This plugin may become a paid add-on when the Craft Plugin store becomes available.

Requirements

Installation

  1. Install with Composer

    composer require dolphiq/craft3-forms

  2. Install plugin in the Craft Control Panel under Settings > Plugins

  3. Add a new directory forms to the root directory of your craft project (next to your config and templates directory) or copy the forms directory from the examples folder in the plugin directory

Directory structure

Below you will find an example directory structure for a contact and a vacancy form

As you can see each form has its own directory. The minimum files are the files in the contact directory. When using every functionallity of this plugin you have as much files as you see in the vacancy directory.

Creating a new form

Lets say that we are going to create a contact form.

  1. Create a directory with the name of your form inside the forms directory. This name will be your form handle later on. In this case it will be named contact
  2. Inside this directory create two files:

    • contactForm.php This file is a model that defines the fields and rules for the form. The name consists of the handle appended with Form.php.

      This file is a model as descriped on: http://www.yiiframework.com/doc-2.0/guide-start-forms.html#creating-model Make sure the class extends the Form model from the plugin and uses the app\forms namespace, if you don't then the plugin won't work.

      Example contactForm.php
    • contactView.php This file is a view with which you can display your form. The name consists of the handle appended with View.php.

      The file is a view file as descriped on: http://www.yiiframework.com/doc-2.0/guide-start-forms.html#creating-views It is important to leave the action of the activeform and the id of the pjax widget id unchanged, else your form won't work.

      Example contactView.php
  3. In your template you can now use the form by using the tag the following tag. Instead of contact you fill in the handle of your form.

Thank you message

When the form is submitted and validated correctly it will be replaced with a thank you message. There are two types of thank you messages:

  1. Default thank you message.

    The plugin comes with a default thank you message. You can overwrite this message by creating a thanks.php file in the forms/ directory. This will then be your default thank you message that is used for all your forms. You can use the form model here to personalize the thank you message.

    Example of a default thank you message
  2. A custom, per form, thank you message

    You can create a thank you message per form so it won't use the default thank you message. This is extra usefull if you want to personalize the thank you message by using the form model.

    Example of a customer, per form, thank you message

Mails

You can enable the plugin to send an email to the form owner and to the person who filled in the form. To do this you can create two files:

  1. contactMailOwner.php This file contains the email that will be send to the owner of the form.

    You can use the $model variable to get attributes from the filled in form.

    Example
  2. contactMailCustomer.php This file contains the email that will be send to the person who filled in the form (if there is an email attribute available en it is filled in).

    You can use the $model variable to get attributes from the filled in form. This way you can personalize the email.

The two mails will be wrapped with a mail layout that is defined in the plugin folder. You can not change this.

CP Settings

In the Controlpanel you can set the settings per form. You can set the following options per form:

Contributors & Developers

Lucas Weijers - [email protected] Brought to you by Dolphiq


All versions of craft3-forms with dependencies

PHP Build Version
Package Version
Requires craftcms/cms Version ^3.1.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 dolphiq/craft3-forms contains the following files

Loading the files please wait ....