Merge pull request #15649 from JMAConsulting/core-1346
[civicrm-core.git] / CRM / Core / Smarty / plugins / function.crmKey.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
10 */
11
12 /**
13 *
14 * @package CRM
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
16 * $Id$
17 *
18 */
19
20 /**
21 * Generate a CRM_Core_Key of a given name
22 *
23 * @param string $params
24 * Params of the {crmKey} call, with the ‘name’ key holding the name of the key.
25 * @param CRM_Core_Smarty $smarty
26 * The Smarty object.
27 *
28 * @return string
29 * the generated key
30 */
31 function smarty_function_crmKey($params, &$smarty) {
32 return CRM_Core_Key::get(
33 $params['name'],
34 CRM_Utils_Array::value('addSequence', $params, 0)
35 );
36 }