|
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 |
FractalizeR Smarty Rookie
Joined: 01 Nov 2003 Posts: 16
|
Posted: Sat Apr 23, 2011 6:10 pm Post subject: SERVER_NAME variable is used in demo |
|
|
Hello.
The demo uses Quote: | {$smarty.server.SERVER_NAME} | in template. But this variable is not set in PHP CLI mode.
So, if you write some tests, utilizing Smarty bundled demo templates or you run demo from command line mode, you will get an error: E_NOTICE: Undefined index: SERVER_NAME.
May be, it's better to utilize only hard-coded values, defined in all CLI, CGI and Apache module modes? _________________ Things are changing,
But nothing changes,
And still there are changes |
|
Back to top |
|
TakingSides Smarty Rookie
Joined: 11 Dec 2010 Posts: 30
|
Posted: Wed Apr 27, 2011 3:30 pm Post subject: |
|
|
before you create a smarty object, simply do this...
Code: | $_SERVER['SERVER_NAME'] = 'my value'; |
Hacky; but functional? |
|
Back to top |
|
FractalizeR Smarty Rookie
Joined: 01 Nov 2003 Posts: 16
|
Posted: Wed Apr 27, 2011 4:01 pm Post subject: |
|
|
TakingSides wrote: | before you create a smarty object, simply do this...
Code: | $_SERVER['SERVER_NAME'] = 'my value'; |
Hacky; but functional? |
Well, yes. That's a solution. _________________ Things are changing,
But nothing changes,
And still there are changes |
|
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
|