Download the PHP package c975l/contactform-bundle without Composer

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

ContactFormBundle

ContactFormBundle does the following:

ContactFormBundle dedicated web page.

ContactFormBundle API documentation.

Bundle installation

Step 1: Download the Bundle

v5.x works with Symfony 6.x. Use v3|4.x for Symfony 4.x Use v2.x for Symfony 3.x Use Composer to install the library

Step 2: Configure the Bundle

Check dependencies for their configuration:

c975LContactFormBundle uses c975L/ConfigBundle to manage configuration parameters. Use the Route "/contact/config" with the proper user role to modify them.

Step 3: Declaration of Twig\Extensions\TextExtension

You have to allow Twig\Extensions\TextExtension in your /config/pacakes/twig_extensions.yaml.

Step 4: Enable the Routes

Then, enable the routes by adding them to the /config/routes.yaml file of your project:

Step 5: Override templates

It is strongly recommended to use the Override Templates from Third-Party Bundles feature to integrate fully with your site.

For this, simply, create the following structure /templates/bundles/c975LContactFormBundle/ in your app and then duplicate the file layout.html.twig in it, to override the existing Bundle file.

In layout.html.twig, it will mainly consist to extend your layout and define specific variables, i.e. :

The template used for sending emails is the one of c975LEmailBundle. Override it in /templates/c975LEmailBundle/emails/layout.html.twig.

How to use

The Route name is contactform_display so you can add link in Twig via ̀{{ path('contactform_display') }}.

The url path is /contact or /{_locale}/contact, so simply access to http://example.com/contact or http://example.com/en/contact to display the form.

You can set the subject by using the url parameter s i.e. http://example.com/contact?s=Subject, the field will be readonly in the form, but, of course it can be changed via the url. The value is sanitized and given (as subject) to the form in order to be able to change title and/or info text based on this value, i.e.

HoneyPot and delay to avoid spam

To avoid ContactFormBundle serving as an entry point to send spam, the field username is a honeypot. It's only displayed to robots and is hidden via css to normal users. If it's filled, then it's not a user, but a bot. There is also a test for the delay used to submit the form. If the form is submitted before the defined delay then it may has not been filled by a human.

For both cases, ContactFormBundle will act as if the mail was sent, but it will not be the case.

Changing infoText

You can change the text displayed at the top of the Contact Form with the following code in your overriding template /templates/c975LContactFormBundle/layout.html.twig:

Events dispatch

Disable "Receive copy" checkbox

You can disable the checkbox to allow user receiving a copy of the email sent, by catching the event CREATE_FORM with the following code. It's useful, for example if the contact form is used to contact another user and you want to preserve its email address.

Set specific data in email sent

In relation with your app specification, it is possible to set specific email data (body, subject, etc.) based on the data sent in form. For this you have to create a listener with the following code:

Update redirect url

You can update the url to be redirected to, after submission of the form, with the following code:

If this project help you to reduce time to develop, you can sponsor me via the "Sponsor" button at the top :)


All versions of contactform-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
c975l/config-bundle Version *
c975l/email-bundle Version *
c975l/services-bundle Version *
c975l/toolbar-bundle Version *
symfony/form Version *
symfony/security-bundle Version *
twig/intl-extra 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 c975l/contactform-bundle contains the following files

Loading the files please wait ....