[development] Is it possible to serialize the output of a custom block and unserialize the value in a page.tpl.php ?

Adrian Rossouw adrian at bryght.com
Wed Jun 18 15:25:20 UTC 2008


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.



More information about the development mailing list