Request variables
The request variables such as get, post, cookies, server, environment, and session variables can be accessed as demonstrated in the examples below:
Example 4-6. displaying request variables
{* display value of page from URL (GET) http://www.domain.com/index.php?page=foo *} {$smarty.get.page} {* display the variable "page" from a form (POST) *} {$smarty.post.page} {* display the value of the cookie "username" *} {$smarty.cookies.username} {* display the server variable "SERVER_NAME" *} {$smarty.server.SERVER_NAME} {* display the system environment variable "PATH" *} {$smarty.env.PATH} {* display the php session variable "id" *} {$smarty.session.id} {* display the variable "username" from merged get/post/cookies/server/env *} {$smarty.request.username} |
|