Download the PHP package emildev/simpleform2b without Composer

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

Build Status Scrutinizer Code Quality Code Coverage

SimpleForm2B - README

A simple form-creator for Anax MVC built with php. Supports all input-types, textarea and submit.

Installation

Download package from packagist using

from your console. When this is done, you can enter your vendor folder and navigate to emildev/simpleform2b. Inside you will find two folders, src and webroot. Inside the src is the main module, leave it there. If you head over to webroot, you will find a folder named simpleform2b. copy that folder and put it in your views directory.

Usage - creating the SimpleForm2B object

Now that the package is properly installed, you can start to use the module. To include the module in your controller, simply create an object with the following reference.

An example where I create an $auth object that contains the SimpleForm2B module would hence look like this:

Usage - using the the SimpleForm2B object

SimpleForm2B contains 5 different methods.

How to use them is explained below

setForm()

setForm() opens the form and contains 3 parameters:

  1. Method
  2. Action
  3. Class

These three parameters are not optional and should always be set before using other methods. An example where I create a new form with the method of post, the action of url:register/check and the class of registerForm should hence look like this:

setInput()

setInput() creates an input type and contains 6 parameters:

  1. type
  2. name
  3. value - optional
  4. id - optional
  5. label - optional
  6. placeholder - optional

If you choose not to use a parameter, define NULL in it's place. You can create how many input-fields you want. They will show up in the order you write them in the controller. An example where I create an input-field with the type of text, name of username, no-value, id of username, label of Insert Username and no-placeholder would look like this:

setTextArea()

setTextArea() creates a textarea for your form. It consists of 5 parameters:

  1. name
  2. value - optional
  3. id - optional
  4. label - optional
  5. placeholder - optional

If you choose not to use a parameter, define NULL in it's place. You can only create one textarea for each form, and it will always end up under the input-fields. An example where I create a textarea with the name of textarea, no-value, no-id, label of Write info and no-placeholder would look like this:

setSubmit()

setSubmit() creates a submit-button at the bottom of your form. It has 2 non-optional parameters:

  1. name
  2. value

This method is quite self-explanatory but if you want to create a submit button which contains the name of submitThis and a value of Send, this is how you write it in your controller:

saveForm()

saveForm() should always be included after all other methods are set. It contains 0 parameters and offers you a way to save the form into a variable which you can pass along to the view. An example of saving the form into the variable $myNewForm would look like this:

When passing along the variable to the view, it should always be named 'form'. An example on how to implement this into Anax-Mvc would be:

Finally

With SimpleForm2B, you can easily create forms in lightning speed. The above information should be everything you need to know. If you still end up with problems, you are free to contact me at [email protected]

Have Fun!


All versions of simpleform2b with dependencies

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

Loading the files please wait ....