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

 
Post new topic   Reply to topic    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
fuzzywolf
Smarty n00b


Joined: 01 Sep 2013
Posts: 1

PostPosted: Sun Sep 01, 2013 9:47 pm    Post subject: Getting values to HTML Reply with quote

How do i easily get a variable stored in smarty Global directly into HTML code?

also can someone explain this line for me:
{if !$GLOBAL.config.website.api.disabled}<tr><td>API Key: </td><td><a href={$smarty.server.PHP_SELF}?page=api&action=getuserstatus&api_key={$GLOBAL.userdata.api_key}&id={$GLOBAL.userdata.id}">{$GLOBAL.userdata.api_key}</a></td></tr>{/if}

how do it know where the getuserstatus.php is? and why page=apI?

Pardon me if the question is dumb, but im really new at this...
Trying to peel of all the layers in a website with php/smarty/html
Back to top
View user's profile Send private message
douglassdavis
Smarty Junkie


Joined: 21 Jan 2008
Posts: 539

PostPosted: Sun Sep 01, 2013 10:04 pm    Post subject: Re: Getting values to HTML Reply with quote

fuzzywolf wrote:
How do i easily get a variable stored in smarty Global directly into HTML code?

also can someone explain this line for me:
{if !$GLOBAL.config.website.api.disabled}<tr><td>API Key: </td><td><a href={$smarty.server.PHP_SELF}?page=api&action=getuserstatus&api_key={$GLOBAL.userdata.api_key}&id={$GLOBAL.userdata.id}">{$GLOBAL.userdata.api_key}</a></td></tr>{/if}

how do it know where the getuserstatus.php is? and why page=apI?

Pardon me if the question is dumb, but im really new at this...
Trying to peel of all the layers in a website with php/smarty/html


{$smarty.server.PHP_SELF}

$smarty.server is the contents of the $_SERVER variable:

http://php.net/manual/en/reserved.variables.server.php

From that page:

PHP_SELF is

The filename of the currently executing script, relative to the document root. For instance, $_SERVER['PHP_SELF'] in a script at the address http://example.com/test.php/foo.bar would be /test.php/foo.bar.


the parameters in the URL such as page=api are all application dependent. You will have to look at the PHP code to find that out.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> General 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