Smarty_Internal_Config example

/** * load a config file, optionally load just selected sections * * @param string $config_file filename * @param mixed $sections array of section names, single section or null * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining */
    public function configLoad($config_file$sections = null)
    {
        // load Config class         $config = new Smarty_Internal_Config($config_file$this->smarty, $this);
        $config->loadConfigVars($sections);
        return $this;
    }

    /** * gets the object of a Smarty variable * * @param string $variable the name of the Smarty variable * @param object $_ptr optional pointer to data object * @param boolean $search_parents search also in parent data * @return object the object of the variable */
$_file = $_fileinfo->getFilename();
                if (!substr_compare($_file$extention, - strlen($extention)) == 0) continue;
                if ($_fileinfo->getPath() == substr($_dir, 0, -1)) {
                    $_config_file = $_file;
                } else {
                    $_config_file = substr($_fileinfo->getPath()strlen($_dir)) . DS . $_file;
                }
                echo '<br>', $_dir, '---', $_config_file;
                flush();
                $_start_time = microtime(true);
                try {
                    $_config = new Smarty_Internal_Config($_config_file$smarty);
                    if ($_config->mustCompile()) {
                        $_config->compileConfigSource();
                        $_count++;
                        echo ' compiled in ', microtime(true) - $_start_time, ' seconds';
                        flush();
                    } else {
                        echo ' is up to date';
                        flush();
                    }
                }
                catch (Exception $e) {
                    
Home | Imprint | This part of the site doesn't use cookies.