Download the PHP package developwithwp/omg-forms without Composer

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

OMG Forms

A WordPress Forms Solution built specifically for Developers.

Table of Contents

Why

As a developer I have often found working with the various Forms Plugins in WordPress to be a pain in the butt. The primary pain point is that these forms generate a ton of deeply nest markup which makes styling these forms to match a design very painful.

Plus sometimes the design calls for radical changes in how that markup is built. While all the top forms plugins allow you the ability to change that markup, it is not usually very straight-forward.

It is my assumption that these plugins have this issue because they were built for the end user, not Developers. You see, most form plugins have a drag and drop interface that allows non-programmers the ability to create the forms. Complex form even! And that is awesome.

But this really highlights the fact that on day one, these plugins were not built for developers. They were built for power users.

Introducing OMG Forms

That is where OMG Forms comes into play. It was built from day one to be for developers and developers only. But how can that be? Don't you need to make it for Power Users? Nope. I believe:

If that is the case, then why wouldn't I use a forms solution that puts the developer experience first? That is where OMG Forms comes into play.

Goals

OMG Forms has a few core goals that it is focused on achieving.

Installation

OMG Forms can be installed via composer.

Once you have installed this package you will need to call Composer's autoloader if your project is not already.

Usage

You are now ready to create your first form. OMG Forms comes with a helper method for creating new forms \OMGForms\Core\register_form().

This function expects an array of arguments similar to how register_post_type expects an array of arguments.

To start lets define a very simple form.

As you can see the form allows for a lot of configuration at both the form and the field level.

Once you have defined a form, you can render it by calling display_form.

Or via a built-in shortcode.

API

\OMGForms\Core\register_form([args])

args

name

Type: string (unique name) Default: none

Argument is used to give your form a unique name. This is the name you will use when it comes time to display your form. Form names need to be snake_case or camelCase.

form_type

Type: string/array (basic-form) Default: none

This setting tells OMG Forms which Addon, or 'type" of form you are making. For example if this were a standard contact form, then you would be using the Basic addon and this argument would be set to basic-form. Other examples would be authorize_net and constant-contact.\

This setting could could also be an array of form_types. This is useful when you need a form to serve multiple purposes. For example [ 'authorize_net', 'basic-form' ]. This configuration will cause your form to charge a user via Authorize.net while also saving a copy of the transaction as a Basic Form Submission.

redirect

Type: boolean (true/false) Default: none

Used to tell OMG Forms that it should redirect after a successful form submission.

redirect_to

Type: string (url) Default: none

If redirect is set to true, OMG Forms will redirect the user to this page.

email

Type: boolean (true/false) Default: none

Used to tell OMG Forms if it should notify someone via email after a successful form submission.

email_to

Type: string (email address) Default: none

If email is set to true, OMG Forms will email this person once a form has been successfully submitted.

success_message

Type: boolean (true/false) Default: none

This message will replace the form after a successful form submission. Unless of course you have set the form to redirect. In that case, the form will simply redirect.

rest_api

Type: boolean (true/false) Default: false

This setting is used by Addon Authors to tell OMG Forms if their addon should use the PHP Api or the Javascript Api. false = JS API and true = PHP API

Again, End Users should not worry about this option. It is up to the addon developer to handle setting this option automatically. Addon author should see the hooks list for information about how to do this properly.

classname

Type: string Default: none

This argument lets you define a css class name which will be added to the form wrapper HTML Element.

groups

Type: array Default: none

This argument lets you define groups. Groups are used to "group" various form fields together. Each group in the groups array is an array itself, which contains the following arguments:

Groups Example
fields

Type: array Default: none

The fields argument will contain all of the fields your form will need. This is where all the magic happens. Each field in the fields array is an array itself, which may contain the following arguments:

Fields Example

Supported Field Types

Customizing the Form

OMG Forms has a built in mechanism which makes override the field html a breeze.

Their are two ways that you can tell OMG Forms which templates to load when rendering a certain field type. However regardless of which option you choose the first thing you need to do is create a forms directory in the root of your theme.

Option 1 This is the easiest option.

Option 2 This option is useful if you need to change the markup for a field type on a per form/field basis. This options has two steps:

List of Hooks

Action Hooks

omg_form_before_form - Allows developers a way to add HTML Markup before the form HTML.

omg_form_before_form_submit - Allows developers a way to add HTML Markup after the HTML form fields, but before the form submit button.

omg_form_after_form - Allows developers a way to add HTML Markup after the form HTML.

omg_form_validation - Provides a way to add additional validation checks. These checks are run by OMG Forms on page load, and are used to notify developers about possible issues they may have with their form.

omg-form-settings-hook - OMG Forms comes with a settings page. This hook allows Addon Authors a way to add additional settings sections and fields to this page.

Filter Hooks

omg_forms_save_data - This is the primary hook used by addon authors to creat their addon, This hook exposes the sanitized and validated data so that Addon can use this data to do whatever it is that addon is supposed to do.

rest_allow_anonymous_entries Allows Addon Authors to restrict form submissions to logged in users. By default this is set to true, meaning anonymous user can submit forms.

omg_forms_sanitize_data - Allows Addon Authors to set additional sanitization steps to the sanitization process.

omg-form-filter-field-args - Allows Addon Authors a way to modify field arguments after they have been set when the form was registered. This is useful when you need to ensure a certain form is setup with a specific field argument.

omg_form_filter_register_args - Similar to omg-form-filter-field-args, this filter lets you modify the entire form arguments after a form was created. For example, lots of Addons use this filter to force a certain form of a specific type to set rest_api => true.

Roadmap


All versions of omg-forms 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 developwithwp/omg-forms contains the following files

Loading the files please wait ....