Skip to content

Instantly share code, notes, and snippets.

@noopable
Created October 14, 2012 07:04
Show Gist options
  • Save noopable/3887684 to your computer and use it in GitHub Desktop.
Save noopable/3887684 to your computer and use it in GitHub Desktop.
Input def sample
<?php
$inputFilter = $form->getInputFilter();
$spec = array(
'name' => 'an_element_name',
'required' => true,
'filters' => array(
array('name' => 'Zend\Filter\StringTrim'),
),
'validators' => array(
array(
'name' => 'NotEmpty',
'break_chain_on_failure' => true,
'options' => array(
'translatorTextDomain' => 'foo_translate_scope',
'message' => 'hole message',
),
),
),
);
$inputFilter->add($spec, 'an_element_name');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment