develooper Front page | perl.php.sandwich.dev | Postings from October 2005

Re: PHP Template Global Variables

Thread Previous | Thread Next
From:
David Wheeler
Date:
October 26, 2005 19:05
Subject:
Re: PHP Template Global Variables
Message ID:
C093C3A1-5507-4AEB-B217-2CE545D5768F@kineticode.com
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

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About