Download the PHP package truecastdesign/welder without Composer

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

Welder - HTML5 Form Builder for PHP

This library provides a simple powerful HTML5 form builder, validator, spam checker, spam submitter, form contents emailer, and more.

It is designed with the end user in mind so the typing is minimized as much as possible and the syntax is as much like HTML as possible with added functionality.

This library blocks form submissions from domains other than the domain the site is on. It also protects against Cross Site Request Forgeries by default.

Install

To install with composer:

Requires PHP 7.0 or newer.

Usage

How to build a form:

Make a new instance

Output the form tag and other hidden fields

The above code will output this HTML

File Uploads

If you are going to use File Uploads in the form, than you need to have the enctype set to multipart/form-data. To set that, pass file=true as an argument on the start method.

Text Fields


The method names are the type of field you want. textarea, checkbox, etc. The double quotes in the property string are not needed if the value does not have spaces. Saves typing by skipping them if not needed.

Supported field types: text, password, hidden, submit, reset, image, file, number, email, tel, date, datetime, datetime-local, month, search, time, url, week, color, range, checkbox, radio, select, button.

The above code will output this HTML

Other examples:

Checkboxes

The above code will output this HTML

Select Menus

The above code will output this HTML

Use an array to set create the options.

Custom Errors

Use the 'error' key to set a custom error to display when the form is submitted and validation errors are displayed.

Form Validation

The validate method takes the field name on the left and the validation method to the right of the equal sign. The available validation methods start with validate_ in the class so you can look them up to see what they do. The clean method runs several content cleaning functions to sanitize the data if it does not conform to any set pattern like emails or names, etc.

You can use the spam method to check if the form is spam. If you want to use Akismet, just pass it the field names for their name, email, and content. They need to be in that order.

If you want to make sure the form does not contain any urls then add the nourls flag like: nourls=true. Setting it to true checks all the fields. If you want to only check certain fields do that like this: nourls="field1,field2".

If you want to check the captcha add the captcha flag. Display the captcha on the page with <?$F->captcha()?>. You will need to move the form-captcha.php file to a public accessible directory and change the include path into to access the Welder.php file.

Spam Content Checking

Welder uses several spam checking method to determine if an email message is likely to be spam. Use the keyword spamcontent and set it equal to the field names you want to check. Example: spamcontent="subject,message"

Gibberish: matches text that is not real words but just random repeated keystrokes like "asdasd" or "qwejjjjjeeee"

Too Many Consonants: Checks if the message has words will more than 6 consonants in a row. Usually means it is invalid words and spam

Keyword Search: Search message for spam keyword phrases that spammers commonly use to sell you something.

Getting and Setting Field values

If you want to populate the form fields from a database record or other source on display of form but not submitting it, use the setFieldValues method to pass a key value array of field name to value. You can set more than one at a time.

You can do this as an else statement on the if($F->validate()) method call if you make sure the view has access to the same Welder instance. Pass the $F variable to the view if needed.

To get a field value or all field values in the view use:

Get all in array.

Configuration

Turn off CSRF protection

Turn off inline field errors

Normally there is outputted a span like:

before each field. If you don't want this tag outputted for some reason, turn it off using the below code.

Use more than one form in a view or controller

You need to set the custom action field value on both the controller instance and the view instance so they match.


All versions of welder with dependencies

PHP Build Version
Package Version
Requires php Version >=7.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 truecastdesign/welder contains the following files

Loading the files please wait ....