happyninjas/lex — Issue #25: Warnings when using if statement
Author: laurentvd
Created: 2012-03-08 13:50:18+00:00
State: open

Great stuff guys. I wonder if I'm using it the right way, but I'm running into the following:

Controller (not I don't supply the middlename):
```php
$lex_parser->parse('myView.lex', array(
'realname' => array(
'firstname' => 'John',
'lastname' => 'Doe'
)
));
```

View:
```lex
{{ realname.firstname }}
{{ if realname.middlename }} {{ realname.middlename }} {{ endif }}
{{ realname.lastname }}
```

Gives me a PHP notice saying:
Message: Use of undefined constant realname - assumed 'realname'
Filename: libraries/Lex_parser.php(728) : eval()'d code

The warning is gone when I supply an empty middlename. Is this the way to go or is there an option to mute the warning?