Symfony/Doctrine: Unserialize in action vs template

Posted by Tom on Stack Overflow See other posts from Stack Overflow or by Tom
Published on 2010-03-25T05:06:45Z Indexed on 2010/03/25 5:13 UTC
Read the original article Hit count: 348

Filed under:
|
|
|
|

Hi,

Can anyone tell me why calling "unserialize" works fine in an action but gives an offset error in a template?

It's basically possible to unserialize a database text result into a variable in an action and pass it to template, in which case it displays fine:

$this->clean = unserialize($this->raw);
<?php echo $clean ?>

But not if called directly in a template:

<?php echo unserialize($raw) ?>

Would be interested in knowing why this is so and whether there's some workaround.

Thanks.

© Stack Overflow or respective owner

Related posts about doctrine

Related posts about serialize