Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

SERVER_NAME variable is used in demo

 
Post new topic   Reply to topic    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:   
Post new topic   Reply to topic    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