Download the PHP package fab/quick-form without Composer

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

Quick Form for TYPO3 CMS

This is a TYPO3 CMS extension which allows to quickly build a form on the Frontend that corresponds to a data type describe by the TCA.

The form can be used with an Extbase but not necessary.

Installation

Installation as "normal" in the Extension Manager.

Configuration

Settings are done by TypoScript in EXT:quick_form/Configuration/TypoScript/setup.txt.

View Helpers

Edit form

There is a View Helper that will read the TCA configuration and will generate the form on the Frontend:

<qf:tca.form type="1" arguments="{_all}" dataType="fe_users"/>

Important to notice, the View Helper will not generate the form tag giving the full flexibility of the action and controller. In other words, the VH must be wrapped by a f:form tag as in the example:

# Regular Extbase Form
<f:form action="update" controller="User" name="user" object="{user}" additionalAttributes="{role: 'form'}">

	<qf:tca.form type="1" arguments="{_all}" dataType="fe_users" validation="tca"/>

</f:form>

Show form (pre-visualisation)

For pre-visualisation needs, the tca.show can be used. It will display the visualisation (read-only) instead of the field for editing.

<f:form action="create" controller="User" name="user" object="{user}" additionalAttributes="{role: 'form'}">

	# tca.show != tca.form
	<qf:tca.show type="1" arguments="{_all}" dataType="fe_users"/>

</f:form>

Flexible Validation

Quick Form will show information on the Frontend whether the field contains validation. This is for now limited to: is required? has error after submit?

It is configured to add a well-known "*" to show the field is required.

To get the validation info, Quick Form has three possible sources that can be configured with attribute "validation". If nothing is configured Quick Form will take the TCA as fallback which has the advantage to keep in sync the Backend and the Frontend.

@todo add more validation output such as string length, email, ...

TCA configuration

In file EXT:sample/Configuration/TCA/tx_sample_domain_model_foo make sure to have a section like:

# Adequate for "flat" structure.
return array(
	'quick_form' => array(
		'1' => 'first_name, last_name, ...',
	),

TCA configuration can be more complex by accepting nested structure:

# Adequate for "nested" structure which contains field-set and other containers.
return array(
	'quick_form' => array(
		'1' => array(
			'partial' => 'Form/FieldSet',
			'items' => array(
				'first_name',
				'last_name',
				array(
					'partial' => 'Form/Submit',
				),
			),
		),
	),

Quick Form also accepts a syntax with object that is a bit more concise than array and that is convenient when working with an IDE which auto-complete parameters:

# Usage of a Quick Form Component
return array(
	'quick_form' => array(
		'1' => array(
			'partial' => 'Form/FieldSet',
			'items' => array(
				'first_name',
				'last_name',
				new \Vanilla\QuickForm\Component\SubmitComponent()
			),
		),
	),

Use "external" Partials

Partials within EXT:quick_start are taken as defaults. However, it is possible to use "external" Partials located in another extension:

new \Vanilla\QuickForm\Component\GenericComponent('Form/Foo', array('property' => 'propertyName', 'label' => 'fieldName'), 'foo'),

Override label

In case the Frontend label must be different than in the BE, use option alternative_label in the arguments of the Form Component:

array(
	'alternative_label' => 'LLL:EXT:bobst_forms/Resources/Private/Language/locallang.xlf:privacy_satement_label',
)

Quick Form Components

A list of all components that can be displayed in a Quick Form. Some of them are a bit more complex to set-up as they need a good TCA configuration along with a correct Extbase code. For those ones, there is code example given below.

CheckboxGroup

array(
	'partial' => 'Form/CheckboxGroup',
	'arguments' => array('label' => 'wheels_or_tracks'),
	'items' => array(
		'operational_data_wheels',
		'operational_data_tracks',
	),
),

Checkbox

If checkbox must be specially configured:

new \Vanilla\QuickForm\Component\CheckboxComponent(
	'hasNewsletterSubscription',
	'has_newsletter_subscription',
	array('group_label' => 'Newsletter')
),

TCA configuration +++++++++++++++++

'operational_data_wheels' => array(
	'exclude' => 0,
	'label' => 'LLL:EXT:ext/Resources/Private/Language/locallang_db.xml:tx_foo_domain_model_foo.operational_data_wheels',
	'config' => array(
		'type' => 'check',
		'default' => '0'
	),
),
'operational_data_tracks' => array(
	'exclude' => 0,
	'label' => 'LLL:EXT:ext/Resources/Private/Language/locallang_db.xml:tx_foo_domain_model_foo.operational_data_tracks',
	'config' => array(
		'type' => 'check',
		'default' => '0'
	),
),

Extbase code ++++++++++++

/**
 * @var int
 * @validate Integer
 */
protected $operationalDataWheels = 0;

/**
 * @var int
 * @validate Integer
 */
protected $operationalDataTracks = 0;

DatePicker

Some more JavaScript is required here. To be found a jQuery plugin for Bootstrap available in this repository in branch "bs3" as of this writing. https://github.com/eternicode/bootstrap-datepicker/tree/bs3

Honey Pot

In TCA:

new \Vanilla\QuickForm\Component\HoneyPotComponent(),

In Extbase controller:

/**
 * @return void
 * @validate $request \Vanilla\QuickForm\Validator\HoneyPotValidator
 * @param \Vendor\Extension\Domain\Model\Foo $foo
 */
public function createAction(Foo $foo = NULL) {


}

TCA configuration +++++++++++++++++

'available_on_market_from' => array(
	'exclude' => 0,
	'label' => 'LLL:EXT:ext/Resources/Private/Language/locallang_db.xml:tx_foo_domain_model_foo.available_on_market_from',
	'config' => array(
		'type' => 'input',
		'size' => 12,
		'max' => 20,
		'eval' => 'date',
		'default' => '0'
	)
),

Extbase code ++++++++++++

/**
 * @var \DateTime
 */
protected $availableOnMarketFrom;

Multi Choice

new \Vanilla\QuickForm\Component\MultiChoicesComponent('protectionLevel'),

TCA configuration +++++++++++++++++

'some_field' => array(
	'exclude' => 0,
	'label' => 'LLL:EXT:ext/Resources/Private/Language/locallang_db.xml:tx_foo_domain_model_foo.some_field',
	'config' => array(
		'type' => 'select',
		'items' => array(
			array('', ''),
			array('LLL:EXT:ext/Resources/Private/Language/locallang_db.xml:tx_foo_domain_model_foo.some_field.label_1', '1'),
			array('LLL:EXT:ext/Resources/Private/Language/locallang_db.xml:tx_foo_domain_model_foo.some_field.label_2', '2'),
		),
		'size' => 4,
		'maxitems' => 10,
		'eval' => ''
	),
),

Extbase code ++++++++++++

Property:

/**
 * @var string
 */
protected $someField;

Beware, a special array-to-string converter must be defined in the Controller in order to convert the multi-choice to a CSV chain:

/**
 * Initialize object
 */
public function initializeAction() {

	// Configure property mapping.
	if ($this->arguments->hasArgument('objectName')) {

		/** @var \Vanilla\QuickForm\TypeConverter\ArrayToStringConverter $typeConverter */
		$typeConverter = $this->objectManager->get('Vanilla\QuickForm\TypeConverter\ArrayToStringConverter');

		$this->arguments->getArgument('request')
			->getPropertyMappingConfiguration()
			->forProperty('someField')
			->setTypeConverter($typeConverter);
	}
}

File Upload

Suggested EXT:media_upload to use the file upload API in your Extbase controller.

new \Vanilla\QuickForm\Component\FileUploadComponent('logo'),

Media Upload

Require EXT:media_upload which provides HTML5 file upload widget.

new \Vanilla\QuickForm\Component\MediaUploadComponent('logo'),

TCA configuration +++++++++++++++++

'logo' => array(
	'exclude' => 0,
	'label' => 'LLL:EXT:ext/Resources/Private/Language/locallang_db.xml:tx_ext_domain_model_organisation.logo',
	'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
			'logo',
			array(
				'appearance' => array(
					'createNewRelationLinkTitle' => 'LLL:EXT:cms/locallang_ttc.xlf:images.addFileReference'
				),
				'minitems' => 0,
				'maxitems' => 1,
			),
			$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
	),
),

Extbase code ++++++++++++

Property:

/**
 * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference>
 */
protected $logo;

Accessor:

/**
 * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference>
 */
public function getLogo() {
	return $this->logo;
}

/**
 * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> $logo
 */
public function setLogo($logo) {
	$this->logo = $logo;
}

/**
 * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $logo
 * @return void
 */
public function addLogo(ObjectStorage $logo) {
	$this->logo->attach($logo);
}

/**
 * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $logo
 * @return void
 */
public function removeLogo(ObjectStorage $logo) {
	$this->logo->detach($logo);
}

All versions of quick-form with dependencies

PHP Build Version
Package Version
No informations.
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 fab/quick-form contains the following files

Loading the files please wait ....