Re: PHP Template Global Variables

[email protected] (David Wheeler) Wed, 26 Oct 2005 19:05:45 -0700
Newsgroups perl.php.sandwich.dev
Message-ID <[email protected]>
On Oct 23, 2005, at 12:06 PM, Scott Lanning wrote:

>>  <?= $story->get_title() ?>
>>
>> Since the Bricolage templates are a relatively controlled  
>> environment, I'm
>> personally not too worried about the pollution. But what do you  
>> think?
>
> I think the same. It's consistent with other burners.


Thanks, Scott. Unfortunately, that might make setting the $element  
variable too the current element by display_element() tricky.  
Currently, it'd done like this:

     $php->eval(q/function setBric($key, $var) {
         global $BRIC;
         $BRIC[$key] = $var;
     }/);

     $php->setBric(element => $elem);

I'm not sure how this could be done to set the global $element  
variable instead of $BRIC['element']. George, is this possible? Could  
you perhaps add a set_global method to PHP::Interpreter to simplify  
this sort of thing?

Thanks,

David