Is it possible to serialize the output of a custom block and unserialize the value in a page.tpl.php ?
Hello, I am trying to serialize the output of a block, which is received in a page.tpl with the $content variable. It seems it does not work, but I don't know why, because I can output the serialized string (using $content) in a page.tpl.php file but if I try to unserialize it and afterwards try to print_r the result, it shows nothing. Does anybody have any clue? It seems quite weird to me...
On 18 Jun 2008, at 5:20 PM, Juan Rodriguez wrote:
Does anybody have any clue? It seems quite weird to me...
might be better and more consistent to use a static embedded in a function. ie: function myblock($variables = null) { static $vars = null; if (is_array($variables)) { $vars = $variables; } return $variables; } and just use the myblock($vars) in the right preprocess or _variables, and use myblock() when you want to get the content.
participants (2)
-
Adrian Rossouw -
Juan Rodriguez