Download the PHP package gcworld/formconfig without Composer

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

GCWorld FormConfig

Packagist Packagist

Packagist PHP Packagist GitHub

FormConfig is a PHP library for defining forms as objects and rendering them with Twig. It provides reusable field types, repeatable field arrays, model and ORM metadata helpers, read-only transformations, configurable CSRF tokens, and a generated fluent field builder.

FormConfig renders form markup but does not persist submitted values or replace application-level validation and authorization.

Version

4.0.2

Requirements

Bootstrap 3 remains the default for backward compatibility. Bootstrap 5 is available through the parallel @form_config_BS5 Twig namespace.

Installation

Install the package from Packagist:

The Composer post-autoload-dump hook performs two setup tasks:

  1. It creates config/GCWorld_FormConfig.yml in the consuming project when the file does not already exist.
  2. It discovers the available field classes and generates the field registry and fluent builder under src/Generated/ in the installed package.

Run composer dump-autoload after registering custom field groups or adding a field class so the generated registry is refreshed.

Basic usage

To render the Bootstrap 5 theme, set the configured form mode and select its controller namespace:

The configured mode is also used when FormConfig renders nested navigation elements and built-in submit-button defaults. Consumers can migrate one application at a time while BS3 remains available.

Fields can also be created generically when the type is selected dynamically:

The generated builder is preferable for normal application code because it provides discoverable methods for every registered field type.

Using an existing Twig environment

Applications that already own a Twig environment can register FormConfig's paths, functions, and tests directly:

mapAll() attaches the @form_config_BS3 and @form_config_BS5 namespaces when the environment uses Twig's FilesystemLoader. Custom form templates can be selected with FormConfig::setTwigTemplate().

Values, requirements, and errors

Values, required levels, and validation errors can be applied by field name:

Requirement level 0 suppresses a field, level 1 renders an optional field, and values greater than 1 render the configured required indicator. Errors whose keys do not match a field are rendered as unattributed form errors.

setValuesFromObject() reads matching getters and legacy model metadata. setPropertiesFromObject() integrates with gcworld/interfaces ORM description objects when that optional model layer is available.

Call makeReadOnly() to convert supported fields to their non-editable representation before rendering.

Repeatable field arrays

createFieldArray() creates table, div, or Ionic-style groups containing one or more rows:

Configuration

The installed config/GCWorld_FormConfig.yml supports these sections:

The optional forms section registers additional namespaces and directories containing custom FieldInterface implementations. Its directories are resolved relative to the consuming project during code generation.

Configuration is cached in process-level singletons. Applications using long-lived PHP workers should restart workers after changing FormConfig configuration.

CSRF responsibility

When CSRF is enabled and both token callbacks are configured, a hidden token field is added to each new form. The consuming application must still validate the submitted request:

FormConfig does not call doCheck() automatically. Applications remain responsible for invoking it at the correct point in their request lifecycle and handling CSRFNotEnabledException or CSRFRequestFailedException.

Browser dependencies

Frontend assets are intentionally not installed through Composer. Consumers must load the dependencies required by the field types they use.

Dependency Used by
Bootstrap 3 or 5 Form layout, containers, validation states, tables, buttons, and responsive classes
jQuery All templates that emit interactive JavaScript
Select2 and the theme-compatible Select2 adapter Normal, HTML, grouped, and Ajax select fields (bootstrap for BS3; bootstrap-5 for BS5)
CKEditor exposing the global CKEDITOR API CKEditor and CKEditorFull fields
Bootstrap Datepicker or a compatible $.fn.datepicker plugin Date fields
Spectrum or a compatible $.fn.spectrum plugin Color picker fields
Font Awesome Help and navigation icons
HoldOn Optional submit/loading overlays and Ajax-once loading overlays

Exact asset versions are controlled by the consuming application. Before upgrading one of these libraries, verify the emitted initialization options and events against the FormConfig field types used by that application.

The BS5 templates use Bootstrap 5-compatible markup and continue using Font Awesome for help and navigation icons. They do not require Bootstrap Icons.

Several extension points intentionally render trusted strings with Twig's raw filter, including HTML fields, labels, notices, headings, hooks, option content, and submit-button overrides. Do not pass untrusted content to these APIs without sanitizing it first.

The templates emit inline scripts. Applications enforcing Content Security Policy must account for those scripts or override the affected templates.

Local development

The supported local environment uses the public KongHack PHP 8.5 image:

The committed Compose configuration mounts only this repository. It does not expose host SSH keys, Composer credentials, or host account databases to the container. Developers who require private Composer authentication can copy docker-compose.override.yml.example to the ignored docker-compose.override.yml. The override exposes credentials to container processes and should only be enabled when it is genuinely required.

Individual quality commands are also available:

PHPStan is enforced at level 6. PHPCS enforces PSR-12 errors; advisory warnings such as line length do not fail the build.

Releases

Releases use bare semantic-version tags such as 3.11.23. Before tagging a release:

  1. Add the release notes to the matching version section in CHANGELOG.md.
  2. Update VERSION and the value immediately below ### Version in this file.
  3. Push the release commit and matching tag.

GitHub Actions validates the release metadata and complete PHP quality matrix before creating the GitHub Release from CHANGELOG.md. Packagist is connected to this repository and receives the published tag through the existing GitHub integration.

Release tags must not be moved or reused.

License

FormConfig is open-source software licensed under the MIT License.


All versions of formconfig with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
composer/composer Version ^2.9
composer/installers Version ^2.2
twig/twig Version ^3.14
kint-php/kint Version >=1.1 <7.0
symfony/yaml Version ^6.0
gcworld/globals Version ^4.0
gcworld/interfaces Version ^4.3.11
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 gcworld/formconfig contains the following files

Loading the files please wait ...