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

SERVER_NAME variable is used in demo

 
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 -> Smarty 3
View previous topic :: View next topic  
Author Message
FractalizeR
Smarty Rookie


Joined: 01 Nov 2003
Posts: 16

PostPosted: Sat Apr 23, 2011 6:10 pm    Post subject: SERVER_NAME variable is used in demo Reply with quote

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
View user's profile Send private message Send e-mail
TakingSides
Smarty Rookie


Joined: 11 Dec 2010
Posts: 30

PostPosted: Wed Apr 27, 2011 3:30 pm    Post subject: Reply with quote

before you create a smarty object, simply do this...

Code:
$_SERVER['SERVER_NAME'] = 'my value';


Hacky; but functional?
Back to top
View user's profile Send private message
FractalizeR
Smarty Rookie


Joined: 01 Nov 2003
Posts: 16

PostPosted: Wed Apr 27, 2011 4:01 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
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 -> Smarty 3 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