Skip to content

Latest commit

 

History

History
32 lines (27 loc) · 803 Bytes

Form.md

File metadata and controls

32 lines (27 loc) · 803 Bytes

Form Helper

An enhanced FormHelper

  • Allow configuration via Configure FormConfig
  • Allow easy enabling/disabling of novalidate this way globally throughout all forms

Configs

  • 'novalidate' => false, // Set to true to disable HTML5 browser validation
  • 'templates' => [...] // Define your own custom default templates for all widgets

Usage

Attach it to your controllers like so:

protected $helpers = ['Tools.Form'];

Alternatively, you can enable it in your AppView class.

Basic Example

// Inside your app.php config:
$config = [
    'debug' => true,
    ...
    'FormConfig' => array(
        'novalidate' => true,
        'templates' => array(
            'dateWidget' => '{{day}}{{month}}{{year}}{{hour}}{{minute}}{{second}}{{meridian}}',
        )
    )
];