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.