input-filter

ZF2 Captcha validation ignored when using an input filter

别来无恙 提交于 2020-01-05 12:23:31
问题 I have a form in my ZF2 app with a CAPTCHA element as follows : $this->add(array( 'type' => 'Zend\Form\Element\Captcha', 'name' => 'captcha', 'attributes' => array( 'class'=>'form-control', ), 'options' => array( 'label' => 'Please verify you are human.', 'captcha' => array('class' => 'Dumb') ), )); I have an input filter attached to the form that validates the other elements in the form (name, email, message). When this is attached to the form the validation for the CAPTCHA field is ignored

Zend Framework 2 - Submitting a form

允我心安 提交于 2019-12-13 07:25:19
问题 I suppose title says everything. The form is rendered as it should, but everything begun when i decided to write an InputFilter for it. The form is still rendered, but of course i had to adapt something around it. Now, however POST request is sent (Firebug agrees), the getPost() method returns false now. Action (in the controller): public function contactAction () { $form = new ContactForm(); $request = $this->getRequest(); if ($request->isPost()) { $vm = new ViewModel(); $vm->setTerminal

DirectShow filter is not shown as input capture device

巧了我就是萌 提交于 2019-12-11 09:43:55
问题 Starting from the great example of Capture Source Filter here I wrote my own input capture device that works fine in Graph Studio Next, but it's not shown as a capture device (i.e. webcam) in application like Skype or similar. Because I want to understand what's happening I ask you to help me to find out what those application need to show such a device. Some relevant code: dll.cpp DEFINE_GUID(CLSID_VirtualCam, 0x8e14549a, 0xdb61, 0x4309, 0xaf, 0xa1, 0x35, 0x78, 0xe9, 0x27, 0xe9, 0x33); const

ZF2 InputFilter not validating fieldset

天大地大妈咪最大 提交于 2019-12-08 09:25:41
问题 i use the following fieldset for grouping information: <input type='text' name='personal[firstname]'> <input type='text' name='personal[lastname]'> Now i want to use an InputFilter to validate the form, but nothing happens: class CustomerFilter extends InputFilter /** * Build filter */ public function init() { $this->add(array( 'name' => 'personal[firstname]', 'required' => true, 'filters' => array( array('name' => 'StringTrim'), array('name' => 'StripTags'), ), 'validators' => array( array(

EditText maxLength property not applied properly when setFilters is used

做~自己de王妃 提交于 2019-11-30 15:45:57
问题 When I use setFilter method on an EditText to handle special characters, maxLength property is not working as expected. My code is below. editName = (EditText)findViewById(R.id.rna_editTextName); editName.setFilters(new InputFilter[]{getFilteredChars()}); //Below method returns filtered characters. public InputFilter getFilteredChars() { InputFilter filter = new InputFilter() { @Override public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {

EditText maxLength property not applied properly when setFilters is used

帅比萌擦擦* 提交于 2019-11-30 15:17:23
When I use setFilter method on an EditText to handle special characters, maxLength property is not working as expected. My code is below. editName = (EditText)findViewById(R.id.rna_editTextName); editName.setFilters(new InputFilter[]{getFilteredChars()}); //Below method returns filtered characters. public InputFilter getFilteredChars() { InputFilter filter = new InputFilter() { @Override public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { if (end > start) { char[] acceptedChars = new char[]{'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',

Empty values passed to Zend framework 2 validators

萝らか妹 提交于 2019-11-27 19:10:27
How can I pass an empty value through Zend framework 2 ValidatorChain to my custom validator? It was possible on ZF1 by allowEmpty(false) On ZF2 with empty element value : If allowEmpty = false , NotEmptyValidator is added to the top of ValidatorChain with breakOnFailure = true , @see Zend/InputFilter/Input#injectNotEmptyValidator . If allowEmpty = true , Element is considered as Valid, @see Zend/InputFilter/BaseInputFilter#isValid if ($input->allowEmpty()) { $this->validInputs[$name] = $input; continue; } Following works for ZF2 version 2.1.1: The problem (if I got it correctly) is that in

Empty values passed to Zend framework 2 validators

家住魔仙堡 提交于 2019-11-26 22:46:35
问题 How can I pass an empty value through Zend framework 2 ValidatorChain to my custom validator? It was possible on ZF1 by allowEmpty(false) On ZF2 with empty element value : If allowEmpty = false , NotEmptyValidator is added to the top of ValidatorChain with breakOnFailure = true , @see Zend/InputFilter/Input#injectNotEmptyValidator . If allowEmpty = true , Element is considered as Valid, @see Zend/InputFilter/BaseInputFilter#isValid if ($input->allowEmpty()) { $this->validInputs[$name] =