Download the PHP package tatter/forms without Composer

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

Tatter\Forms

RESTful AJAX forms for CodeIgniter 4

Coverage Status

Quick Start

  1. Install with Composer: > composer require tatter/forms
  2. Publish the assets: > php spark assets:publish
  3. Add the JavaScript to your views

Features

Provides Resource and Presenter controller templates and corresponding JavaScript for using AJAX forms with CodeIgniter 4's native RESTful implementation.

Installation

Install easily via Composer to take advantage of CodeIgniter 4's autoloading capabilities and always be up-to-date:

Or, install manually by downloading the source files and adding the directory to app/Config/Autoload.php.

After installation you will need to copy or publish the required assets to your public/ folder. If you want to automate this process check out the Assets Library.

Finally, notify your view/layout of your intention to use the JavaScript for your forms (your paths may vary):

Configuration (optional)

The library's default behavior can be overridden or augment by its config file. Copy examples/Forms.php to app/Config/Forms.php and follow the instructions in the comments. If no config file is found the library will use its defaults.

Usage

Note: Please consider this module to be modular itself - you need not use every piece! Treat portions of the code that you do not use as examples for how to implement this in your own app.*

After the initial installation there are a few pieces to implement. Forms will run CRUD-style operations for you by interfacing views with the ResourcePresenter or ResourceController depending on the method of interaction (i.e. page load versus AJAX). Not surprisingly, you will need some Views and two Controllers per resource.

Naming

Forms interacts with each resource route and controller through that resource's name. If you are creating a game, your resource names might be hero(es), level(s), reward(s), etc. The naming convention is important for autoloading resources and their endpoints. By default, Forms will use the name of the model associated with your resource. So a URL of heroes/new would route to the HeroController which uses HeroModel and the whole resource would be dubbed "hero" off that model.

If you need to set your own names, do so with your model's $name property:

Views

If you choose to use the built-in Controllers they expect the following views to be available for each resource (where {names} is the plural of your resource name):

As you can see Forms expects some views that are part of a full page load layout and some that can be injected into an existing page via AJAX (e.g. in a modal). See examples for a full set of example view files (note: these are presented "as is" and may not always be the best solution for all use cases).

Controllers

In addition to the views, you will need two controllers for each resource:

As with other framework RESTful controllers, your controllers set their model via the $modelName property:

Your resource controller can take an additional property, $format, to specify response format (Forms currently only supports JSON):

See RESTful Resource Handling in the CodeIgniter 4 User Guide for more info on using resource controllers.

Routes

You will need to add routes to both controllers for every resource:

By default your resource controller routes will all be prefixed "api/", but you can change this in your config file.

JavaScript

Forms includes a light set of JavaScript commands for passing data between your views and controllers and auto-handling AJAX requests. If you want a more complete set of functions, or fully automated object handler you will want to include your own third-party tools and implement them in your view files.

jQuery

This package uses jQuery (not included). Future versions will drop jQuery in favor of native JavaScript (via Fetch).


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

Loading the files please wait ....