Closed billmn closed 11 years ago
With the release 1.12.0 of Twig now we have this error :
LogicException [ Error ]: Unable to add global "%GLOBAL_VARIABLE%" as the runtime or the extensions have already been initialized.
This because with this release "Global Variables" must be initialized before the Lexer instance and then can be overwritten on render :
Check this discussion : https://groups.google.com/forum/?fromgroups=#!topic/silex-php/Ew-Fs5VXqlQ
The problem is the position of addGlobal() method :
if ( ! empty($global_data)) { foreach ($global_data as $key => $value) { static::parser()->addGlobal($key, $value); } }
How can we solve this?
Fixed by 468ee76ed58d8820bd4cbf99e824d29967185a6b
With the release 1.12.0 of Twig now we have this error :
This because with this release "Global Variables" must be initialized before the Lexer instance and then can be overwritten on render :
Check this discussion : https://groups.google.com/forum/?fromgroups=#!topic/silex-php/Ew-Fs5VXqlQ
The problem is the position of addGlobal() method :
How can we solve this?