Download the PHP package rafaelwendel/ci4formbuilder without Composer

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

CI4FormBuilder

Library to build and manage forms in a CodeIgniter 4 projects (Object-Oriented way).

Content

Instalation & Loading

CI4FormBuilder is available on Packagist, and instalation via Composer is the recommended way to install it. Add the follow line to your composer.json file:

or run

Components

The following form components are available to use.

How to use

Basic Usage

The cited components can be instantiated and added to a Form.

The above code prints the following result

Another example using more components

Output:

Using a Template

With the Template class it is possible to define a default layout for a Form and its components. The following options are available for use

Example

Output:

Setting Form Data

You can pass the value of a component in the constructor itself. Like:

However, it is also possible to pass an array or object containing the data to be set through the setFormData method in $form instance. Data can be provide from a model or a request.

Setting Error Messages

To include error messages (usually validation errors), just pass them to the setErrorsValidation method. In addition, also configure the template for displaying errors

Output

Bonus: Form Types

The FormTypeAbstract class provides a standard structure for creating types (objects) related to the form that will be created.

To make the creation of these classes easier, you can generate a FormType class using the Spark CLI command provided by this library:

For example, to create a product form type, run:

This command will automatically create the ProductType class in the app/FormTypes folder, extending FormTypeAbstract and containing the template structure.

For example, let's implement a product form with name and price fields. To do this, we will create the ProductType (extending FormTypeAbstract) class in the app/FormTypes folder (either manually or using the generator command above). (Note: we must implement the abstract setComponents method defined in the FormTypeAbstract class)

We will use this ProductType in the Products controller

Same type for edit action

Finally, in the type constructor it is possible to pass the template option (discussed in Using a Template) and the submit label.


All versions of ci4formbuilder with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.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 rafaelwendel/ci4formbuilder contains the following files

Loading the files please wait ...