|
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 |
byargv Smarty n00b
Joined: 17 Nov 2015 Posts: 2
|
Posted: Tue Nov 17, 2015 11:47 am Post subject: when session start,the '.' (period) symbol not effect |
|
|
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 |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Tue Nov 17, 2015 5:39 pm Post subject: |
|
|
You're making no sense. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed Nov 25, 2015 6:19 am Post subject: |
|
|
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 |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Wed Nov 25, 2015 12:58 pm Post subject: |
|
|
Shouldn't the search for constants be case-sensitive? |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed Nov 25, 2015 7:38 pm Post subject: |
|
|
PHP functions like defined(), used to check if a name is a constant, are not cases sensitive. |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Wed Nov 25, 2015 10:59 pm Post subject: |
|
|
Err… >.< PHP… So much for language consistency. |
|
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
|