2017 © Pedro Peláez
 

library console-validable-question

Easily Validate Questions in Symfony/Console

image

p4bloch/console-validable-question

Easily Validate Questions in Symfony/Console

  • Tuesday, December 23, 2014
  • by p4bloch
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

ValidableQuestion

Easily validate a Symfony/Console Question., (*1)

Usage

$question = new ValidableQuestion('Who are you?', ['required']);
$question = new ValidableQuestion('How old are you?', ['numeric'], 25);
$question = new ValidableQuestion('Enter your e-mail', ['required', 'email']);

$helper->ask($input, $output, $question);

Why?

Validating a Question in Symfony/Console involves calling setValidator on each Question and passing the function that will actually validate it as an argument, which is awesome when you need to do a somehow complex validation, but quite annoying when you simply want to check if the value is not null, or a number, or an e-mail, etc. ValidableQuestion extends Console's Question, but validates the answer against any rules specified in the background, leaving you with a nice and readable one liner., (*2)

The Versions

23/12 2014

dev-master

9999999-dev http://github.com/p4bloch/console-validable-question

Easily Validate Questions in Symfony/Console

  Sources   Download

MIT

The Requires

 

by Pablo Chiappetti

validation console symfony

23/12 2014

0.1.0

0.1.0.0 http://github.com/p4bloch/console-validable-question

Easily Validate Questions in Symfony/Console

  Sources   Download

MIT

The Requires

 

by Pablo Chiappetti

validation console symfony

23/12 2014

0.1.0.x-dev

0.1.0.9999999-dev http://github.com/p4bloch/console-validable-question

Easily Validate Questions in Symfony/Console

  Sources   Download

MIT

The Requires

 

by Pablo Chiappetti

validation console symfony