function content_5629522a6bb574_62502339($_smarty_tpl)
    {
        $_smarty_tpl->properties['nocache_hash'] = '153405629522a5fccc6_81697907';
        Smarty_Internal_Extension_Config::configLoad($_smarty_tpl, "test.conf", "setup", 'local');
        echo $_smarty_tpl->getSubTemplate("header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 9999, $_smarty_tpl->cache_lifetime, array('title' => 'foo'), 0);
        ?>


<HTML>
    <HEAD>
        <TITLE><?php 
        echo $_smarty_tpl->tpl_vars['title']->value;
        ?>
 - <?php 
        echo '/*%%SmartyNocache:153405629522a5fccc6_81697907%%*/<?php echo $_smarty_tpl->tpl_vars[\'Name\']->value;?>
/*/%%SmartyNocache:153405629522a5fccc6_81697907%%*/';
        ?>
</TITLE>
    </HEAD>

    <BODY bgcolor="#ffffff">

        <form>


        </form>
    </BODY>
</HTML>
<?php 
        echo $_smarty_tpl->getSubTemplate("footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 9999, $_smarty_tpl->cache_lifetime, array(), 0);
        ?>

<?php 
    }
    function content_5592b4a8c1f559_52106510($_smarty_tpl)
    {
        $_smarty_tpl->properties['nocache_hash'] = '111975592b4a8bf45d2_56807861';
        ?>

<?php 
        Smarty_Internal_Extension_Config::configLoad($_smarty_tpl, "site.conf", null, 'local');
        ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html> 
<head> 
<title><?php 
        echo $_smarty_tpl->tpl_vars['title']->value;
        ?>
</title> 
</head> 
<body> 
<p> 
Hi, <?php 
        echo $_smarty_tpl->tpl_vars['name']->value;
        ?>
. Welcome to the wonderful world of Smarty. 
</p> 
</body> 
</html><?php 
    }
 function content_566a89fb44ab02_58402340($_smarty_tpl)
 {
     Smarty_Internal_Extension_Config::loadConfigVars($_smarty_tpl, array('sections' => array('setup' => array('vars' => array('bold' => true))), 'vars' => array('title' => 'Welcome to Smarty!', 'cutoff_size' => 40)));
 }
Пример #4
0
 /**
  * Deassigns a single or all config variables
  *
  * @param  string $varname variable name or null
  *
  * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
  */
 public function clearConfig($varname = null)
 {
     return Smarty_Internal_Extension_Config::clearConfig($this, $varname);
 }
 function content_566185f0c8e471_75274572($_smarty_tpl)
 {
     Smarty_Internal_Extension_Config::loadConfigVars($_smarty_tpl, array('sections' => array('setup' => array('vars' => array('bold' => true))), 'vars' => array('title' => 'Welcome to Smarty!', 'cutoff_size' => 40)));
 }
    function content_56453e89398133_84829262($_smarty_tpl)
    {
        if (!is_callable('smarty_modifier_capitalize')) {
            require_once '/var/www/html/smarty/libs/plugins/modifier.capitalize.php';
        }
        if (!is_callable('smarty_modifier_date_format')) {
            require_once '/var/www/html/smarty/libs/plugins/modifier.date_format.php';
        }
        if (!is_callable('smarty_function_html_select_date')) {
            require_once '/var/www/html/smarty/libs/plugins/function.html_select_date.php';
        }
        if (!is_callable('smarty_function_html_select_time')) {
            require_once '/var/www/html/smarty/libs/plugins/function.html_select_time.php';
        }
        if (!is_callable('smarty_function_html_options')) {
            require_once '/var/www/html/smarty/libs/plugins/function.html_options.php';
        }
        $_smarty_tpl->properties['nocache_hash'] = '141063041656453e88eecc04_08919544';
        Smarty_Internal_Extension_Config::configLoad($_smarty_tpl, "test.conf", "setup", 'local');
        echo $_smarty_tpl->getSubTemplate("header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 9999, $_smarty_tpl->cache_lifetime, array('title' => 'foo'), 0);
        ?>


<PRE>


    <?php 
        if ($_smarty_tpl->getConfigVariable('bold')) {
            ?>
<b><?php 
        }
        ?>
        
        Title: <?php 
        echo smarty_modifier_capitalize($_smarty_tpl->getConfigVariable('title'));
        ?>

        <?php 
        if ($_smarty_tpl->getConfigVariable('bold')) {
            ?>
</b><?php 
        }
        ?>

    The current date and time is <?php 
        echo smarty_modifier_date_format(time(), "%Y-%m-%d %H:%M:%S");
        ?>


    The value of global assigned variable $SCRIPT_NAME is <?php 
        echo $_smarty_tpl->tpl_vars['SCRIPT_NAME']->value;
        ?>


    Example of accessing server environment variable SERVER_NAME: <?php 
        echo $_SERVER['SERVER_NAME'];
        ?>


    The value of {$Name} is <b><?php 
        echo '/*%%SmartyNocache:141063041656453e88eecc04_08919544%%*/<?php echo $_smarty_tpl->tpl_vars[\'Name\']->value;?>
/*/%%SmartyNocache:141063041656453e88eecc04_08919544%%*/';
        ?>
</b>

variable modifier example of {$Name|upper}

<b><?php 
        echo '/*%%SmartyNocache:141063041656453e88eecc04_08919544%%*/<?php echo mb_strtoupper($_smarty_tpl->tpl_vars[\'Name\']->value, \'UTF-8\');?>
/*/%%SmartyNocache:141063041656453e88eecc04_08919544%%*/';
        ?>
</b>


An example of a section loop:

    <?php 
        if (isset($_smarty_tpl->tpl_vars['smarty']->value['section']['outer'])) {
            unset($_smarty_tpl->tpl_vars['smarty']->value['section']['outer']);
        }
        $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['name'] = 'outer';
        $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['loop'] = is_array($_loop = $_smarty_tpl->tpl_vars['FirstName']->value) ? count($_loop) : max(0, (int) $_loop);
        unset($_loop);
        $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['show'] = true;
        $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['max'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['loop'];
        $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['step'] = 1;
        $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['start'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['step'] > 0 ? 0 : $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['loop'] - 1;
        if ($_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['show']) {
            $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['total'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['loop'];
            if ($_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['total'] == 0) {
                $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['show'] = false;
            }
        } else {
            $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['total'] = 0;
        }
        if ($_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['show']) {
            for ($_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['index'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['start'], $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['iteration'] = 1; $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['iteration'] <= $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['total']; $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['index'] += $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['step'], $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['iteration']++) {
                $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['rownum'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['iteration'];
                $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['index_prev'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['index'] - $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['step'];
                $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['index_next'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['index'] + $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['step'];
                $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['first'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['iteration'] == 1;
                $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['last'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['iteration'] == $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['total'];
                ?>
        <?php 
                if (1 & $_smarty_tpl->getVariable('smarty')->value['section']['outer']['index'] / 2) {
                    ?>
            <?php 
                    echo $_smarty_tpl->getVariable('smarty')->value['section']['outer']['rownum'];
                    ?>
 . <?php 
                    echo $_smarty_tpl->tpl_vars['FirstName']->value[$_smarty_tpl->getVariable('smarty')->value['section']['outer']['index']];
                    ?>
 <?php 
                    echo $_smarty_tpl->tpl_vars['LastName']->value[$_smarty_tpl->getVariable('smarty')->value['section']['outer']['index']];
                    ?>

        <?php 
                } else {
                    ?>
            <?php 
                    echo $_smarty_tpl->getVariable('smarty')->value['section']['outer']['rownum'];
                    ?>
 * <?php 
                    echo $_smarty_tpl->tpl_vars['FirstName']->value[$_smarty_tpl->getVariable('smarty')->value['section']['outer']['index']];
                    ?>
 <?php 
                    echo $_smarty_tpl->tpl_vars['LastName']->value[$_smarty_tpl->getVariable('smarty')->value['section']['outer']['index']];
                    ?>

        <?php 
                }
                ?>
        <?php 
            }
        } else {
            ?>
        none
    <?php 
        }
        ?>

    An example of section looped key values:

    <?php 
        if (isset($_smarty_tpl->tpl_vars['smarty']->value['section']['sec1'])) {
            unset($_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']);
        }
        $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['name'] = 'sec1';
        $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['loop'] = is_array($_loop = $_smarty_tpl->tpl_vars['contacts']->value) ? count($_loop) : max(0, (int) $_loop);
        unset($_loop);
        $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['show'] = true;
        $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['max'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['loop'];
        $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['step'] = 1;
        $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['start'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['step'] > 0 ? 0 : $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['loop'] - 1;
        if ($_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['show']) {
            $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['total'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['loop'];
            if ($_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['total'] == 0) {
                $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['show'] = false;
            }
        } else {
            $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['total'] = 0;
        }
        if ($_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['show']) {
            for ($_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['index'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['start'], $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['iteration'] = 1; $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['iteration'] <= $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['total']; $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['index'] += $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['step'], $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['iteration']++) {
                $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['rownum'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['iteration'];
                $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['index_prev'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['index'] - $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['step'];
                $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['index_next'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['index'] + $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['step'];
                $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['first'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['iteration'] == 1;
                $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['last'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['iteration'] == $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['total'];
                ?>
        phone: <?php 
                echo $_smarty_tpl->tpl_vars['contacts']->value[$_smarty_tpl->getVariable('smarty')->value['section']['sec1']['index']]['phone'];
                ?>

        <br>

            fax: <?php 
                echo $_smarty_tpl->tpl_vars['contacts']->value[$_smarty_tpl->getVariable('smarty')->value['section']['sec1']['index']]['fax'];
                ?>

        <br>

            cell: <?php 
                echo $_smarty_tpl->tpl_vars['contacts']->value[$_smarty_tpl->getVariable('smarty')->value['section']['sec1']['index']]['cell'];
                ?>

        <br>
    <?php 
            }
        }
        ?>
    <p>

        testing strip tags
        <table border=0><tr><td><A HREF="<?php 
        echo $_smarty_tpl->tpl_vars['SCRIPT_NAME']->value;
        ?>
"><font color="red">This is a test </font></A></td></tr></table>

</PRE>

This is an example of the html_select_date function:

<form>
    <?php 
        echo smarty_function_html_select_date(array('start_year' => 1998, 'end_year' => 2010), $_smarty_tpl);
        ?>

</form>

This is an example of the html_select_time function:

<form>
    <?php 
        echo smarty_function_html_select_time(array('use_24_hours' => false), $_smarty_tpl);
        ?>

</form>

This is an example of the html_options function:

<form>
    <select name=states>
        <?php 
        echo smarty_function_html_options(array('values' => $_smarty_tpl->tpl_vars['option_values']->value, 'selected' => $_smarty_tpl->tpl_vars['option_selected']->value, 'output' => $_smarty_tpl->tpl_vars['option_output']->value), $_smarty_tpl);
        ?>

    </select>
</form>

<?php 
        echo $_smarty_tpl->getSubTemplate("footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 9999, $_smarty_tpl->cache_lifetime, array(), 0);
        ?>

<?php 
    }
 function content_562952ef57e868_66987095($_smarty_tpl)
 {
     Smarty_Internal_Extension_Config::loadConfigVars($_smarty_tpl, array('sections' => array('setup' => array('vars' => array('bold' => true))), 'vars' => array('title' => 'Welcome to Smarty!', 'cutoff_size' => 40)));
 }
 function content_56264020118e62_65579880($_smarty_tpl)
 {
     Smarty_Internal_Extension_Config::loadConfigVars($_smarty_tpl, array('sections' => array('setup' => array('vars' => array('bold' => true))), 'vars' => array('title' => 'Welcome to Smarty!', 'cutoff_size' => 40)));
 }
Пример #9
0
 /**
  * Returns a single or all config variables
  * @param  string $varname variable name or null
  * @param bool $search_parents
  * @return string variable value or or array of variables
  */
 public function getConfigVars($varname = NULL, $search_parents = TRUE)
 {
     return Smarty_Internal_Extension_Config::getConfigVars($this, $varname, $search_parents);
 }
 function content_562649d0db89a2_26437148($_smarty_tpl)
 {
     Smarty_Internal_Extension_Config::loadConfigVars($_smarty_tpl, array('sections' => array('setup' => array('vars' => array('bold' => true))), 'vars' => array('title' => 'Welcome to Smarty!', 'cutoff_size' => 40)));
 }
 function content_5649b754d646d4_37128650($_smarty_tpl)
 {
     Smarty_Internal_Extension_Config::loadConfigVars($_smarty_tpl, array('sections' => array('setup' => array('vars' => array('bold' => true))), 'vars' => array('title' => 'Welcome to Smarty!', 'cutoff_size' => 40)));
 }
 function content_5660aa7c455650_84523945($_smarty_tpl)
 {
     Smarty_Internal_Extension_Config::loadConfigVars($_smarty_tpl, array('sections' => array('setup' => array('vars' => array('bold' => true))), 'vars' => array('title' => 'Welcome to Smarty!', 'cutoff_size' => 40)));
 }
 function content_55a10bf5528859_55392397($_smarty_tpl)
 {
     Smarty_Internal_Extension_Config::loadConfigVars($_smarty_tpl, array('sections' => array('setup' => array('vars' => array('bold' => true))), 'vars' => array('title' => 'Welcome to Smarty!', 'cutoff_size' => 40)));
 }
 function content_5592b6d9c061d9_63768170($_smarty_tpl)
 {
     Smarty_Internal_Extension_Config::loadConfigVars($_smarty_tpl, array('sections' => array(), 'vars' => array('site_title' => 'TShirtShop: Demo Product Catalog from Beginning PHP and MySQL E-Commerce')));
 }