Download the PHP package luyadev/luya-module-contactform without Composer

On this page you can find all versions of the php package luyadev/luya-module-contactform. 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 luya-module-contactform

LUYA Logo

Contactform Module

Tests Maintainability Test Coverage Total Downloads

This module provides a very fast and secure way to create customizable contact forms.

Installation

Require the contact module via composer

add the contact form module to your config:

To defined the attribute labels you can configure the module as followed:

By default LUYA will wrap the value into the Yii::t('app', $value) functions so you are able to translate the attributes labels. The above exmaple would look like this Yii::t('app', 'E-Mail').

Integrate the Module

In order to use the module inside the LUYA CMS, just pick the Module Block and drag the block into the page. After droped the block edit the module block and picke the contactform module. This will then maybe throw an exception that there is no view file. In order to create the view file follow the next section.

View Files

Typically view files are located in views folder of your project root, create the view file for the corresponding model data at views/contactform/default/index.php with the following content:

when the form validation success the variable $success will be true, in addition a Yii2 flash mesage Yii::$app->session->setFlash('contactform_success') with the key-name contactform_success will be set.

In order to ensure a form is only submited once use the LUYA Core SubmitButtonWidget.

Tip: In order to style required fields with asterisks, you can use the following CSS:

Trigger after success

You can define a anonmys function which will be trigger after success, the first parameter of the function can be the model which will be assigne [[\luya\base\DynamicModel]]. Example callback:

Ordering fields in email

You can oder the fields in the mail wich will be send to the contact form recipient. This could be put before the rules in the contact form config.

For short and small forms this notation could be used as well:

For long and complex form we would recommend this notation:

Advanced configuration

attribte example
mailTitle The mail title is also known as the mail subject
mailText This is a message which can be used as intro for the mail body. Markdown parsing is enabled by default.
sendToUserEmail If enabled, the mail will also be sent to the user who has submitted the form, configure the property with the mail field from the model.
callback An anyonymus function find the model argument in order to trigger custom functions.

All versions of luya-module-contactform with dependencies

PHP Build Version
Package Version
No informations.
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 luyadev/luya-module-contactform contains the following files

Loading the files please wait ....