2017 © Pedro Peláez
 

library validator

Do action and filters with Herbert

image

flycartinc/validator

Do action and filters with Herbert

  • Thursday, March 16, 2017
  • by flycart
  • Repository
  • 3 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Flycart Validator for Herbert

Add the bellow piece of code in plugin.php to set $app in Facade, (*1)

if ( is_plugin_active(plugin_basename( __FILE__ )) ) {, (*2)

$plugin = new \Herbert\Framework\Base\Plugin(plugin_dir_path( __FILE__ ));, (*3)

$herbert->registerPlugin($plugin);, (*4)

$app = $plugin->getContainer();, (*5)

FlycartValidator\Facades\Facade::setFacadeApplication($app);, (*6)

}, (*7)

Add the bellow piece of code in herbert.config.php to load FlycartHook service provider, (*8)

'providers' => array(, (*9)

FlycartValidator\ValidationServiceProvider::class, (*10)

), (*11)

# Flycart Validator Example, (*12)

Validate single data, (*13)

$data = \FlycartValidator\Facades\Validator::single($data, ['num', 'min:3']), (*14)

Validate multiple data, (*15)

$data = \FlycartValidator\Facades\Validator::multiple($data, [ 'field-name' => ['alnum', 'min:5'], 'email' => ['email'], 'age' => ['num'] ]);, (*16)

returns empty value for the key failed else the value as send., (*17)

The Versions

16/03 2017

dev-master

9999999-dev

Do action and filters with Herbert

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Ashlin Rejo