-- Patrick Lorber <[email protected]> wrote
(on Sunday, 27 September 2009, 06:18 PM -0700):
> I've recently updated from 1.8 to 1.9.3PL I have a form that I use for
> allowing the creation of newsletters. I'm getting an error that states:
> Support for multiple arguments is deprecated in favor of a single options
> array in
> C:\Server\Apache2\htdocs\bible9\library\Zend\Filter\HtmlEntities.php on line
> 66
>
>
> My original Code looked like this:
>
>
> /**
> * This is where the Form is initialized and Set up
> */
> public function init(){
> $subject = $this->addElement('text', 'subject', array(
> 'filters' => array(
> 'StringTrim',
> array( 'HtmlEntities', ENT_QUOTES),
> 'Alnum'
> ),
>
>
> So, I then changed the code to include an array for the filter options as
> follows:
>
>
> /**
> * This is where the Form is initialized and Set up
> */
> public function init(){
> $subject = $this->addElement('text', 'subject', array(
> 'filters' => array(
> 'StringTrim',
> array(
> 'filter' => 'HtmlEntities',
> 'options' => array(
> 'quotestyle' => ENT_QUOTES
> )
> ),
> 'Alnum'
> ),
>
> For some reason I am still getting the same error as before. It appears
> that even with the later code that the integer 3 is being passed to the
> consructor of Zend_Filter_HtmlEntities. Perhaps I have misunderstood the
> usage. Could someone please help
Because the value is sent to call_user_func_array(), you need to wrap
the configuration array:
$subject = $this->addElement('text', 'subject', array(
'filters' => array(
'StringTrim',
array(array(
'filter' => 'HtmlEntities',
'options' => array(
'quotestyle' => ENT_QUOTES
)
)),
'Alnum'
),
--
Matthew Weier O'Phinney
Project Lead | [email protected]
Zend Framework | http://framework.zend.com/