develooper Front page | | Postings from October 2005

Re: PHP Template Global Variables

Thread Previous | Thread Next
David Wheeler
October 26, 2005 19:05
Re: PHP Template Global Variables
Message ID:
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?



Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About