Last active
July 27, 2018 18:50
-
-
Save dusta/85d8e638977298ebb3a351b2acb0a9ff to your computer and use it in GitHub Desktop.
Smarty plugin Dframe/Token
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Smarty plugin for Dframe\Token | |
* ------------------------------------------------------------- | |
* File: function.token.php | |
* Type: function | |
* Name: token | |
* Purpose: outputs a token | |
* ------------------------------------------------------------- | |
*/ | |
/* | |
* Instalation: | |
* Put file in to app/Libs/Plugins/smarty/function.token.php | |
* Usage: {token name='userToken'} | |
*/ | |
function smarty_function_token($name){ | |
$token = new \Dframe\Token(new \Dframe\Session(APP_NAME)); | |
return $token->generate($name['name'])->get($name['name']); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment