Download the PHP package hassanalthaf/formbuildercomponent without Composer

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

Form Builder Component

Contents

- What this is

- How to use this

- How to contribute

- Credits

What this is

This is an easy-to-use Form Builder Component. It only is built currently for generating HTML form codes. But, I have built this in such a way, that it would be easy to make it generate code for form codes in other languages maybe because you are lazy to type all in yourself and want to do the job in an automated way.

How to use this

It's quite simple to do that! Firstly, you need to require this in your composer.json file like this by running:

composer require hassanalthaf/formbuildercomponent

Once you run that, you will have it into your application.

Then, you simply need to:

That will enable you to use the Form Builder component. What you have to do next is to define a FormBuilder like this:

Once you have run the above code, and if you view your page source, you'll notice that the

element has been created. In this package, there are various kinds of form elements you can create.

To create a label, all you have to do is write this code after the newForm(...) method call:

And for an input field, you do something like this:

Quite simple yeah? Well, now you might wanna save all your code and try to view what it shows. You might notice a label and an input field for password. Well done! You have got hold of the basics of how to use this. Next up, lets see how to use a TextArea.

And now, once you save it, it will show you a decent and nice textarea.

Next up, we have the amazing buttons to submit data. This is an example button:

Easy, yeah? Let us move onto something a bit more complicated than these basic form elements. Lets see how radio buttons are defined.

In the above code, you will notice a $radioButton variable. This is basically an instance of the HtmlRadioButton class. This class basically takes in an argument to define the name attribute of the radio button <select> element. Once that is defined, you need to define the actual radio buttons which are the <option> elements. So in this example, I have created two. The $maleField and the $femaleField. And then after defining them, I just add them to the $radioButton class. And all I have to do is add the $radioButton class onto the $formBuilder. That is it!

Last but not the least, drop down lists!

So in this above dropdown list, I basically created an object HtmlDropDownList() assigned to $dropDownList and then, I created list elements, namely: $buggatiListElement, $lamborghiniListElement, $ferrariListElement. After creating those list elements, I simply added them to the $dropDownList and then finally added the $dropDownList to the $formBuilder

That is basically it I believe! But what makes this more amazing is the fact that you are able to remove and change elements, attributes etc using PHP very easily!

Let us consider that after you save the form, you want to remove the textarea we created above, all we do is:

That will remove it, simple as that.

How to contribute

Do you want to contribute, but do not know how? Well, it is simple. You can always take a look at the pull requests, issues, etc and help others out. Or otherwise, if you want to contribute to the code base, you can always help me maintain the code base by adding more form elements, etc and optimizing the code time to time. Such helpers are highly welcome!

Credits

Hassan Althaf - Main Developer <hassan [at] hassanalthaf [dot] com>


All versions of formbuildercomponent with dependencies

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

Loading the files please wait ....