0

Below line

tal:attributes="action php:GLOBALS['paypal']['url']"

raises:

PHPTAL_VariableNotFoundException' with message 'Unable to find variable 'GLOBALS' in current scope'

while

tal:attributes="action php:GLOBALS['paypal']['url']"

works

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
  • 1
    I don't see any difference between first and second example. Are you sure you copied that correctly? – Kornel Jun 25 '13 at 23:51

1 Answers1

1

It's not a good practice to rely on globals at all. You should be passing variables to PHPTAL explicitly:

$phptal->set('paypal', $GLOBALS['paypal']);

and then use action="${paypal/url}"

or if you really must:

$phptal->set('GLOBALS', $GLOBALS);
Kornel
  • 97,764
  • 37
  • 219
  • 309