Monday 1 September 2014

Smarty: Request variables and other useful smarty functions


{$smarty} reserved variable The PHP reserved {$smarty} variable can be used to access several enviroment and request variables. The full list of them follows. Request variables {* display value of page from URL ($_GET) phplessonstips.blogspot.in/index.php?page=foo *} {$smarty.get.page} {* display the variable "page" from a form ($_POST['page']) *} {$smarty.post.page} {* display the value of the cookie "username" ($_COOKIE['username']) *} {$smarty.cookies.username} {* display the server variable "SERVER_NAME" ($_SERVER['SERVER_NAME'])*} {$smarty.server.SERVER_NAME} {* display the system environment variable "PATH" *} {$smarty.env.PATH} {* display the php session variable "id" ($_SESSION['id']) *} {$smarty.session.id} {* display the variable "username" from merged get/post/cookies/server/env *} {$smarty.request.username} {$smarty.now} The current timestamp can be accessed with {$smarty.now} {* use the date_format modifier to show current date and time *} {$smarty.now|date_format:'%Y-%m-%d %H:%M:%S'} {$smarty.version} Returns the version of Smarty the template was compiled with.

No comments:

Post a Comment

List OF BANK PAN Numbers

List OF BANK PAN Numbers Bank/Home Loan Providers PAN Number Allahabad Bank AACCA8464F Andhra Bank AABCA7375C Axis Bank...