sfOutputEscaperArrayDecorator means you have output escaping enabled,
and any data you send to the view gets escaped for safety. You can
still use it as an array, like $content_tabs["key1"], the only
difference you'll see is that you need not use htmlspecialchars() or
anything like that.

On Tue, Jan 5, 2010 at 04:06, SB <[email protected]> wrote:
> Hello,
>
> I'm trying to do something really simple (I thought), send an array
> from the controller to the template.
>
> actions.class.php:
> $this->content_tabs = array('key1' => 'value1', 'key2' => 'value2');
>
> indexSuccess.php:
> var_dump($content_tabs);
>
> gives:
> object(sfOutputEscaperArrayDecorator)[69]
>  private 'count' => null
>  protected 'value' =>
>    array
>      'key1' => string 'value1' (length=6)
>      'key2' => string 'value2' (length=6)
>  protected 'escapingMethod' => string 'esc_specialchars' (length=16)
>
> However, if I try to output a simple scalar variable, i.e.:
>
> actions.class.php
> $this->content_tabs = 'test';
>
> indexSuccess.php
> var_dump($content_tabs);
>
> gives:
> string 'test' (length=4)
>
> I get the same result if I try to set a request parameter as an array
> in a filter, i.e.
>
> myFilter.php:
> $this->getContext()->getRequest()->setParameter('content_tabs', array
> ('key1' => 'value1', 'key2' => 'value2'));
>
> if i output this in myFilter.php:
> var_dump($this->getContext()->getRequest()->getParameter
> ('content_tabs'));
>
> gives:
> array
>  'key1' => string 'value1' (length=6)
>  'key2' => string 'value2' (length=6)
>
> but if i output in indexSuccess.php:
> var_dump($sf_request->getParameter('content_tabs'));
>
> gives:
> object(sfOutputEscaperArrayDecorator)[69]
>  private 'count' => null
>  protected 'value' =>
>    array
>      'key1' => string 'value1' (length=6)
>      'key2' => string 'value2' (length=6)
>  protected 'escapingMethod' => string 'esc_specialchars' (length=16)
>
> Why is this happening?  Is there no way to send arrays to the view
> layer?
>
> thanks!
>
> SB
>
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "symfony users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/symfony-users?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.


Reply via email to