Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

$smarty->assign("varname",empty) - no output fr

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
WeeZard
Smarty n00b


Joined: 15 May 2003
Posts: 2

PostPosted: Thu May 15, 2003 9:20 am    Post subject: $smarty->assign("varname",empty) - no output fr Reply with quote

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
View user's profile Send private message
AZTEK
Smarty Pro


Joined: 16 Apr 2003
Posts: 235
Location: Purdue University

PostPosted: Thu May 15, 2003 11:09 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Thu May 15, 2003 11:24 am    Post subject: Reply with quote

"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
View user's profile Send private message Send e-mail Visit poster's website
WeeZard
Smarty n00b


Joined: 15 May 2003
Posts: 2

PostPosted: Thu May 15, 2003 12:11 pm    Post subject: Reply with quote

my error reporting is:
Code:
error_reporting(E_ALL - E_NOTICE);
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Thu May 15, 2003 1:13 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Thu May 15, 2003 5:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP