#009290: Reserverd names may not be used as template variables in include send statement

Description:

Reserverd names may not be used as template variables in include send statement

Error:
Parse error: syntax error, unexpected T_CLASS, expecting T_STRING or T_VARIABLE or '{' or '$' in ... on line 7

Template:


{include 'foo.tpl'
    send 'hilighted' as $class}

Compiled:


<?php
// Generated PHP file from template code.
// If you modify this file your changes will be lost when it is regenerated.
$_ezcTemplate_output = "";
$_ezc_t = clone $this->template;
$_ezc_t -> send = new ezcTemplateVariableCollection();
$_ezc_t -> send -> class = "hilighted";
$_ezcTemplate_output .= $_ezc_t -> process("foo.tpl");
unset($_ezc_t);
$_ezcTemplate_output .= "";
return $_ezcTemplate_output;
?>

Possible solution for the line causing the parse error:


$_ezc_t -> send -> {'class'} = "hilighted";

Or just throw an exception on inproper names.


Environment:

Operating System:
PHP Version: 5.2
Database and version:


- Attachments

No attachments for this issue.


- Comments

Fixed in trunk rev. 3836.

Removed the spaces around the '->', which also solves the problem.

#250068 by Raymond Bosman on October 31st, 2006 [Permanent Link]

- History
Properties
Type Bug
Priority Low
Component Components » Template
Affects 1.1beta1 - Template 1.1beta1
Fix Versions 2006.2beta2 - eZ components 2006.2beta2
1.1beta2 - Template 1.1beta2
Reporter Kore Nordmann
Responsible Raymond Bosman
Status 0 Closed
Resolution Fixed
Created October 28th, 2006
Updated October 31st, 2006
Resolved October 31st, 2006
 
Navigation [Permanent Link]
Previous Issue
Back to Issues List
Next Issue: #015537
  Graph shows to small and truncated rotated axis labels