|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
WeeZard Smarty n00b
Joined: 15 May 2003 Posts: 2
|
Posted: Thu May 15, 2003 9:20 am Post subject: $smarty->assign("varname",empty) - no output fr |
|
|
if I assign empty to ANY smarty variable like this:
Code: | $smarty->assign("varname",empty) |
then I get empty page with NO errors and even the debug window doesn't open.
As soon as I comment the line, everything works fine. |
|
Back to top |
|
AZTEK Smarty Pro
Joined: 16 Apr 2003 Posts: 235 Location: Purdue University
|
Posted: Thu May 15, 2003 11:09 am Post subject: |
|
|
Why not just assign "" if you know its empty. The keyword empty might have something to do internally with Smarty is why it didnt work. _________________ "Imagine a school with children that can read and write, but with teachers who cannot, and you have a metaphor of the Information Age in which we live." -Peter Cochrane |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Thu May 15, 2003 11:24 am Post subject: |
|
|
"empty" is a php language-construct. your statement isn't valid php code. turn your error-reporting on or look in your error-logs. don't try to do php without error-reporting, it doesn't work |
|
Back to top |
|
WeeZard Smarty n00b
Joined: 15 May 2003 Posts: 2
|
Posted: Thu May 15, 2003 12:11 pm Post subject: |
|
|
my error reporting is:
Code: | error_reporting(E_ALL - E_NOTICE); |
|
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Thu May 15, 2003 1:13 pm Post subject: |
|
|
and your display_errors -flag ?
when i run $smarty->assign('foo', empty);
i get:
<b>Parse error</b>: parse error, unexpected ')', expecting '(' in <b>empty.php</b> on line <b>1</b><br />
empty is definately not allowed in php, only as "empty($foo)" pseudo-function (as i said: language construct, which means uber-function), use one of
- 0
- null
- false
- ""
- ''
- 'empty'
- "empty"
btw: this is not a smarty-issue, it's a php-issue. |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Thu May 15, 2003 5:31 pm Post subject: |
|
|
right -- in other words, you also CAN NOT do this in PHP:
$a = empty;
Please remember to read your PHP error logs! |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|