2017 © Pedro Peláez
 

cakephp-plugin cakephp-parsley-helper

CakePHP Form Helper for Parsley.js automatic validation integration

image

codaxis/cakephp-parsley-helper

CakePHP Form Helper for Parsley.js automatic validation integration

  • Tuesday, January 26, 2016
  • by codaxis
  • Repository
  • 3 Watchers
  • 8 Stars
  • 96 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

CakePHP Parsley.js Form Helper

DEPRECATION WARNING: This plugin is not maintained anymore., (*1)

CakePHP Form Helper for Parsley.js automatic validation integration, (*2)

This helper will automatically read validation rules from active form model and assign field attributes accordingly., (*3)

Compatible with Cake 2.4.7+, (*4)

Feel free to make any code/docs contributions or post any issues., (*5)

Basic usage

  1. Enable the helper plugin in your app/Config/bootstrap.php by doing CakePlugin::load('ParsleyHelper'); - or just CakePlugin::loadAll();., (*6)

  2. Load helper in your app/Controller/AppController.php. You can use the classname option if you want to keep your helper alias as "Form"., (*7)

    // In AppController.php
    
    public $helpers = array('ParsleyHelper.ParsleyForm');
    // or
    public $helpers = array('Form' => array('className' => 'ParsleyHelper.ParsleyForm'));
    
  3. Enable Parsley rules integration in any form by setting parsley => true or data-parsley-validate => true in Form->create() options array., (*8)

    echo $this->Form->create('MyModel', array('parsley' => true));
    
  4. That's all! When you create an input field, parsley attributes will be set according to the defined validation rules., (*9)

Trait usage

If you are running PHP 5.4 or greater, and already using a custom or vendor form helper, you can make use of provided ParsleyFormTrait and retain both helper functionalities. You can do so by creating a custom helper in your app/View/Helper folder like this:, (*10)

// In app/View/Helper

App::uses('ParsleyFormTrait', 'ParsleyHelper.View/Helper');

class MyFormHelper extends VendorFormHelper {
    use ParsleyFormTrait;
}

The Versions

26/01 2016

dev-master

9999999-dev https://github.com/Codaxis/parsley-helper

CakePHP Form Helper for Parsley.js automatic validation integration

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

cakephp form validation parsley

13/06 2014

dev-before-create

dev-before-create https://github.com/Codaxis/parsley-helper

CakePHP Form Helper for Parsley.js automatic validation integration

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

cakephp form validation parsley

19/05 2014

1.0

1.0.0.0 https://github.com/Codaxis/parsley-helper

CakePHP Form Helper for Parsley.js automatic validation integration

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

cakephp form validation parsley

01/05 2014

dev-update-travis

dev-update-travis https://github.com/Codaxis/parsley-helper

CakePHP Form Helper for Parsley.js automatic validation integration

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

cakephp form validation parsley

30/04 2014

0.9

0.9.0.0 https://github.com/Codaxis/parsley-helper

CakePHP Form Helper for Parsley.js automatic validation integration

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

cakephp form validation parsley