Source for file function.pnconfiggetvar.php
Documentation is available at function.pnconfiggetvar.php
* Zikula Application Framework
* @copyright (c) 2004, Zikula Development Team
* @link http://www.zikula.org
* @version $Id: function.pnconfiggetvar.php 24342 2008-06-06 12:03:14Z markwest $
* @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
* @package Zikula_Template_Plugins
* Smarty function to get configuration variable
* This function obtains a configuration variable from the Zikula system.
* Note that the results should be handled by the pnvarprepfordisplay or the
* pnvarprephtmldisplay modifier before being displayed.
* - name: The name of the config variable to obtain
* - assign: If set, the results are assigned to the corresponding variable instead of printed out
* Welcome to <!--[pnconfiggetvar name="sitename"]-->!
* @author Andreas Stratmann
* @param array $params All attributes passed to this function from the template
* @param object &$smarty Reference to the Smarty object
* @param bool $html (optional) If true then result will be treated as html content
* @param string $assign (optional) If set then result will be assigned to this template variable
* @param string $default (optional) The default value to return if the config variable is not set
* @return string the value of the last status message posted, or void if no status message exists
$name = isset ($params['name']) ? $params['name'] : null;
$default = isset ($params['default']) ? $params['default'] : null;
$html = isset ($params['html']) ? $params['html'] : null;
$assign = isset ($params['assign']) ? $params['assign'] : null;
$smarty->trigger_error("pnconfiggetvar: parameter [name] required");
$smarty->assign($assign, $result);
|