"Fossies" - the Fresh Open Source Software Archive

Member "smarty-3.1.34/libs/sysplugins/smarty_internal_method_registerdefaultconfighandler.php" (28 Feb 2019, 1175 Bytes) of package /linux/www/smarty-3.1.34.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "smarty_internal_method_registerdefaultconfighandler.php" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 3.1.32_vs_3.1.33.

    1 <?php
    2 
    3 /**
    4  * Smarty Method RegisterDefaultConfigHandler
    5  *
    6  * Smarty::registerDefaultConfigHandler() method
    7  *
    8  * @package    Smarty
    9  * @subpackage PluginsInternal
   10  * @author     Uwe Tews
   11  */
   12 class Smarty_Internal_Method_RegisterDefaultConfigHandler
   13 {
   14     /**
   15      * Valid for Smarty and template object
   16      *
   17      * @var int
   18      */
   19     public $objMap = 3;
   20 
   21     /**
   22      * Register config default handler
   23      *
   24      * @api Smarty::registerDefaultConfigHandler()
   25      *
   26      * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj
   27      * @param callable                                                        $callback class/method name
   28      *
   29      * @return \Smarty|\Smarty_Internal_Template
   30      * @throws SmartyException              if $callback is not callable
   31      */
   32     public function registerDefaultConfigHandler(Smarty_Internal_TemplateBase $obj, $callback)
   33     {
   34         $smarty = $obj->_getSmartyObj();
   35         if (is_callable($callback)) {
   36             $smarty->default_config_handler_func = $callback;
   37         } else {
   38             throw new SmartyException('Default config handler not callable');
   39         }
   40         return $obj;
   41     }
   42 }