zend-filter

Zend form and Zend filter HtmlEntities

Hi. I have a registration form with a few fields. One of them looks like this: $first_name = new Zend_Form_Element_Text('first_name'); $first_name ->setLabel("First name") ->setRequired(true) ->addFilter(new Zend_Filter_HtmlEntities()); I use the same form for editing user's deta...

How to validate multidimensional array in Zend ?

Hello ! I am wondering what is the best way to validate multidimensional array using Zend_Validate with Zend_FilterInput. Here is my current code: $filters = array( 'symbol' => array('StripTags', 'StringTrim'), 'mode' => array('StripTags', 'StringTrim'), ); $validators = array( 'symbol' => array('N...

Zend_Filter_Input filtering not triggering

I'm using Zend_Filter_Input on my magic getter / setter methods to validate my input and cast fields to the type I desire. The validation portion is working great, but it's like the filters aren't triggering at all. Here is the relevant logic from my model: public function getFilters() { $filters = array( '*' ...

Zend_Form and Zend_Filter

How to disable filtering in Zend_Form before its re-populating? ...

Inject filter into Zend_View

Hi! I wish to set some properties in MyFilter with constructor injection but it seems impossible with Zend_View::addFilter(string $filter_class_name) since it loads a new instance upon usage. MyFilter implements Zend_Filter_Interface. Can I somehow inject an instance of a filter to an instance of Zend_View? Closing since it (hopefully...

Zend Framework: My custom form filter is not filtering!

So I have a form that is using a custom filter (which is really just a copy of Zend_Filter_Null). When I call it directly, it works: $makeZeroNull = new My_Filter_MakeZeroNull(); $null = $makeZeroNull->filter('0'); //$null === null However, when I try to add it to an element in my form, it doesn't filter the value when I call getValue...

/regexp?/ on HTML, but not in form

Possible Duplicate: RegEx match open tags except XHTML self-contained tags I need to do some regex replacement on HTML input, but I need to exclude some parts from filtering by other regexp. (e.g. remove all <a> tags with specific href="example.com…, except the ones that are inside the <form> tag) Is there any smart regex te...

Zend Framework: How to filter input, turning zero to null, then validate null?

So I've determined that my validator does not get called when I filter the input value and turn zero into null. $this->addElement('select', 'State_ID', array('label' => 'State', 'multiOptions' => $this->getStates(), 'validators' => array($requiredBasedOnCountry), 'filters' => array($makeZeroNull))); The reason I am doing this is beca...

How to filter and validate user input in Zend Framework

Hi, on my website I have a comment section. I want to filter and validate the input before I store it in my database. If there are any invalid chars in the input the user gets the notice that his input is invalid. My question, which chars are not allowed? e.g. I want to avoid sql injections Tags are not allowed. How do I check that? ...