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

when session start,the '.' (period) symbol not effect

 
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 -> Bugs
View previous topic :: View next topic  
Author Message
byargv
Smarty n00b


Joined: 17 Nov 2015
Posts: 2

PostPosted: Tue Nov 17, 2015 11:47 am    Post subject: when session start,the '.' (period) symbol not effect Reply with quote

Code:


session_start(); //when session_start

$smarty->assign(array(
        'list' => array('sid'=>3),
));
$smarty->display('demo.html');



Code:

1:{$list['sid']}<br />  shows good!
2:{$list.sid}<br />  shows nothing!
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Tue Nov 17, 2015 5:39 pm    Post subject: Reply with quote

You're making no sense.
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Wed Nov 25, 2015 6:19 am    Post subject: Reply with quote

session_start() does define a constant sid.

when compiling {$list.sid} it first looks for a constant if not found it uses sid as array index.
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Wed Nov 25, 2015 12:58 pm    Post subject: Reply with quote

Shouldn't the search for constants be case-sensitive?
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Wed Nov 25, 2015 7:38 pm    Post subject: Reply with quote

PHP functions like defined(), used to check if a name is a constant, are not cases sensitive.
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Wed Nov 25, 2015 10:59 pm    Post subject: Reply with quote

Err… >.< PHP… So much for language consistency.
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 -> Bugs 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