当前位置: 首页>>代码示例>>PHP>>正文


PHP smarty_function_eval函数代码示例

本文整理汇总了PHP中smarty_function_eval函数的典型用法代码示例。如果您正苦于以下问题:PHP smarty_function_eval函数的具体用法?PHP smarty_function_eval怎么用?PHP smarty_function_eval使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了smarty_function_eval函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fetchFromData

 /**
  * Render output from template data
  * 
  * @param   string  $data		The template to render
  * @param	bool	$display	If rendered text should be output or returned
  * @return  string  Rendered output if $display was false
  **/
 function fetchFromData($tplSource, $display = false)
 {
     if (!function_exists('smarty_function_eval')) {
         require_once SMARTY_DIR . '/plugins/function.eval.php';
     }
     return smarty_function_eval(array('var' => $tplSource), $this);
 }
开发者ID:BackupTheBerlios,项目名称:xoops4-svn,代码行数:14,代码来源:smarty.php

示例2: smarty_function_oxeval

/**
 * Smarty function
 * -------------------------------------------------------------
 * Purpose: eval given string
 * add [{ oxeval var="..." }] where you want to display content
 * -------------------------------------------------------------
 *
 * @param array  $aParams  parameters to process
 * @param smarty &$oSmarty smarty object
 *
 * @return string
 */
function smarty_function_oxeval($aParams, &$oSmarty)
{
    if ($aParams['var'] && $aParams['var'] instanceof oxField) {
        $aParams['var'] = trim($aParams['var']->getRawValue());
    }
    // processign only if enabled
    if (oxRegistry::getConfig()->getConfigParam('bl_perfParseLongDescinSmarty') || isset($aParams['force'])) {
        include_once $oSmarty->_get_plugin_filepath('function', 'eval');
        return smarty_function_eval($aParams, $oSmarty);
    }
    return $aParams['var'];
}
开发者ID:ioanok,项目名称:symfoxid,代码行数:24,代码来源:function.oxeval.php

示例3: fetchFromData

 /**
  * Renders output from template data
  *
  * @param string  $tplSource The template to render
  * @param bool    $display   If rendered text should be output or returned
  * @param null    $vars
  *
  * @return string Rendered output if $display was false
  */
 function fetchFromData($tplSource, $display = false, $vars = null)
 {
     if (!function_exists('smarty_function_eval')) {
         require_once SMARTY_DIR . '/plugins/function.eval.php';
     }
     if (isset($vars)) {
         $oldVars = $this->_tpl_vars;
         $this->assign($vars);
         $out = smarty_function_eval(array('var' => $tplSource), $this);
         $this->_tpl_vars = $oldVars;
         return $out;
     }
     return smarty_function_eval(array('var' => $tplSource), $this);
 }
开发者ID:RanLee,项目名称:Xoops_demo,代码行数:23,代码来源:template.php

示例4: smarty_modifier_attribute_data

function smarty_modifier_attribute_data($value)
{
    cw_load('attributes');
    $data = "";
    $use_description =& cw_session_register('use_description', true);
    if (preg_match('/(\\w+)\\.name/', $value, $matches)) {
        // Get attribute name by field
        $field_name = $matches[1];
        if (!empty($field_name)) {
            $attribute_id = cw_attributes_get_attribute_by_field($field_name);
            $attribute = cw_func_call('cw_attributes_get_attribute', array('attribute_id' => $attribute_id));
            $data = $attribute['name'];
        }
    } else {
        if (preg_match('/(\\w+)\\.value/', $value, $matches)) {
            // Get attribute value by field
            global $product_filter;
            $pf =& $product_filter;
            $field_name = $matches[1];
            if ($pf && $field_name) {
                foreach ($pf as $pf_value) {
                    if ($pf_value['field'] == $field_name) {
                        if ($pf_value['selected']) {
                            foreach ($pf_value['selected'] as $pfs_value) {
                                if (isset($pf_value['values'][$pfs_value])) {
                                    $data = $pf_value['values'][$pfs_value]['name'];
                                }
                            }
                        }
                    }
                }
            }
        } else {
            if ($use_description && preg_match('/(\\w+)\\.description/', $value, $matches)) {
                // Get attribute value by field
                $field_name = $matches[1];
                if (!empty($field_name)) {
                    global $smarty;
                    $attribute_id = cw_attributes_get_attribute_by_field($field_name);
                    $attribute = cw_func_call('cw_attributes_get_attribute', array('attribute_id' => $attribute_id));
                    $use_description = false;
                    require_once $smarty->_get_plugin_filepath('function', 'eval');
                    $data = smarty_function_eval(array('var' => $attribute['description']), $smarty);
                    $use_description = true;
                }
            }
        }
    }
    return $data;
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:50,代码来源:modifier.attribute_data.php

示例5: smarty_function_morgos_side_box

function smarty_function_morgos_side_box($params, &$smarty)
{
    if (array_key_exists('BoxTitle', $params)) {
        $title = trim($params['BoxTitle']);
    } elseif (array_key_exists('EvalBoxTitle', $params)) {
        $title = trim($params['EvalBoxTitle']);
        $valArray['var'] = '{' . $title . '}';
        $valArray['assign'] = null;
        include_once SMARTY_CORE_DIR . '../plugins/function.eval.php';
        $title = smarty_function_eval($valArray, $smarty);
        // not so clean
    } else {
        $smarty->trigger_error("Theme: error");
    }
    if (!array_key_exists('BoxContentFile', $params)) {
        $smarty->trigger_error("Theme: error");
    }
    $smarty->assign('BoxContent', $smarty->fetch($params['BoxContentFile']));
    $smarty->assign('BoxTitle', $title);
    $SideBox = $smarty->fetch('sidebox.tpl');
    return $SideBox;
}
开发者ID:BackupTheBerlios,项目名称:morgos-svn,代码行数:22,代码来源:function.morgos_side_box.php

示例6: array

     }
 }
 $products2 = array();
 if (!empty($message['products2'][0]['id'])) {
     foreach ($message['products2'] as $product) {
         $products2[] = cw_func_call('cw_product_get', array('id' => $product['id'], 'info_type' => 0));
     }
 }
 if ($products1 || $products2) {
     $smarty->assign('products1', $products1);
     $smarty->assign('products2', $products2);
 }
 // compile body
 $template = $message['body'];
 require_once $smarty->_get_plugin_filepath('function', 'eval');
 $compiled_body = smarty_function_eval(array('var' => $template), $smarty);
 // update newsletter
 if (!empty($message['news_id'])) {
     $news_id = cw_vertical_response_edit_message($list_id, $message['news_id'], $compiled_body, $message['subject']);
     if ($news_id) {
         cw_array2update('newsletter', array('news_id' => $news_id, 'updated_date' => cw_core_get_time(), 'subject' => $message['subject'], 'body' => $message['body'], 'allow_html' => 1), "news_id = '{$message['news_id']}'");
         $top_message['content'] = cw_get_langvar_by_name("msg_adm_news_message_upd");
     }
 } else {
     $news_id = cw_vertical_response_edit_message($list_id, 0, $compiled_body, $message['subject']);
     if ($news_id) {
         cw_array2insert('newsletter', array('news_id' => $news_id, 'list_id' => $list_id, 'send_date' => cw_core_get_time(), 'updated_date' => cw_core_get_time(), 'created_date' => cw_core_get_time(), 'subject' => $message['subject'], 'body' => $message['body'], 'allow_html' => 1, 'show_as_news' => 2));
         $message['news_id'] = $news_id;
         $top_message['content'] = cw_get_langvar_by_name("msg_adm_news_message_add");
     }
 }
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:31,代码来源:news.php

示例7: smarty_function_sugar_getimage

                    <?php 
                        if (isset($this->_tpl_vars['field_defs'][$this->_tpl_vars['field']]['dependency']) && $this->_tpl_vars['field_defs'][$this->_tpl_vars['field']]['dependency']) {
                            ?>
                        <?php 
                            echo smarty_function_sugar_getimage(array('name' => "SugarLogic/icon_dependent", 'ext' => ".png", 'alt' => $this->_tpl_vars['mod_strings']['LBL_DEPENDANT'], 'other_attributes' => 'class="right_icon"'), $this);
                            ?>

                    <?php 
                        }
                        ?>
                                        <span id='le_label_<?php 
                        echo $this->_tpl_vars['idCount'];
                        ?>
'>
                    <?php 
                        echo smarty_function_eval(array('var' => $this->_tpl_vars['col']['label'], 'assign' => 'label'), $this);
                        ?>

                    <?php 
                        if (!empty($this->_tpl_vars['translate']) && !empty($this->_tpl_vars['col']['label'])) {
                            ?>
                        <?php 
                            echo smarty_function_sugar_translate(array('label' => $this->_tpl_vars['label'], 'module' => $this->_tpl_vars['language']), $this);
                            ?>

                    <?php 
                        } else {
                            ?>
		                <?php 
                            if (!empty($this->_tpl_vars['current_mod_strings'][$this->_tpl_vars['label']])) {
                                ?>
开发者ID:BMLP,项目名称:memoryhole-ansible,代码行数:31,代码来源:%%F9^F91^F9140B64%%layoutView.tpl.php

示例8: smarty_block_tikimodule

$_block_repeat = true;
smarty_block_tikimodule($this->_tag_stack[count($this->_tag_stack) - 1][1], null, $this, $_block_repeat);
while ($_block_repeat) {
    ob_start();
    ?>

<div id="<?php 
    echo $this->_tpl_vars['user_module_name'];
    ?>
" <?php 
    if ($_COOKIE[$this->_tpl_vars['user_module_name']] != 'c') {
        ?>
style="display:block;"<?php 
    } else {
        ?>
style="display:none;"<?php 
    }
    ?>
>
<?php 
    echo smarty_function_eval(array('var' => $this->_tpl_vars['user_data']), $this);
    ?>

</div>
<?php 
    $_block_content = ob_get_contents();
    ob_end_clean();
    $_block_repeat = false;
    echo smarty_block_tikimodule($this->_tag_stack[count($this->_tag_stack) - 1][1], $_block_content, $this, $_block_repeat);
}
array_pop($this->_tag_stack);
开发者ID:noikiy,项目名称:owaspbwa,代码行数:31,代码来源:4B839B3D%%user_module.tpl.php

示例9: smarty_function_eval

        ?>
      <b>Interfaces:</b><br />
      <?php 
        echo smarty_function_eval(array('var' => $this->_tpl_vars['compiledinterfaceindex']), $this);
        ?>

      <?php 
    }
    ?>

      <?php 
    if ($this->_tpl_vars['compiledclassindex']) {
        ?>
      <b>Classes:</b><br />
      <?php 
        echo smarty_function_eval(array('var' => $this->_tpl_vars['compiledclassindex']), $this);
        ?>

      <?php 
    }
    ?>
      <?php 
}
?>
    </td>
    <td>
      <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">

<?php 
if (!$this->_tpl_vars['hasel']) {
    echo smarty_function_assign(array('var' => 'hasel', 'value' => false), $this);
开发者ID:quantrocket,项目名称:planlogiq,代码行数:31,代码来源:%%-13^%%-135052920^header.tpl.php

示例10: compileIfTemplate

 private function compileIfTemplate($templateId, $params)
 {
     $ul = $_COOKIE['ul'];
     if (!($ul === 'en' || $ul === 'ru' || $ul === 'am')) {
         $ul = 'en';
     }
     $params["ul"] = $ul;
     $template = null;
     if (strlen($templateId) <= 50) {
         $template = EmailTemplatesManager::getInstance()->getTemplate($templateId, $ul);
     }
     if (!isset($template)) {
         return $templateId;
     }
     $smarty = new FAZSmarty();
     $lm = LanguageManager::getInstance(null, null);
     $params["all_phrases"] = $lm->getAllPhrases();
     $smarty->assign("ns", $params);
     require_once $smarty->_get_plugin_filepath('function', 'eval');
     return smarty_function_eval(array('var' => $template), $smarty);
 }
开发者ID:pars5555,项目名称:pcstore,代码行数:21,代码来源:EmailSenderManager.class.php

示例11: smarty_function_eval

    <div class="modal hide pagination-size">

        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal"><i class="icon-remove"></i></button>
            <h3><?php 
echo $this->_tpl_vars['Captions']->GetMessageString('ChangePageSizeTitle');
?>
</h3>
        </div>

        <div class="modal-body">
            <?php 
$this->assign('row_count', $this->_tpl_vars['PageNavigator']->GetRowCount());
?>
            <p><?php 
echo smarty_function_eval(array('var' => $this->_tpl_vars['Captions']->GetMessageString('ChangePageSizeText')), $this);
?>
</p>

            <table class="table table-bordered">
                <tr>
                    <th><?php 
echo $this->_tpl_vars['Captions']->GetMessageString('RecordsPerPage');
?>
</th>
                    <th><?php 
echo $this->_tpl_vars['Captions']->GetMessageString('TotalPages');
?>
</th>
                </tr>
                <?php 
开发者ID:eroncalli,项目名称:atig,代码行数:31,代码来源:%%95^95F^95FFCA23%%page_navigator.tpl.php

示例12: smarty_function_math

        ?>
	<div id="section<?php 
        echo smarty_function_math(array('equation' => "counter - 1", 'counter' => $this->_foreach['sections']['iteration']), $this);
        ?>
">
	<?php 
        if ($this->_tpl_vars['section']->getTitle()) {
            ?>
<h4><?php 
            echo $this->_tpl_vars['section']->getTitle();
            ?>
</h4><?php 
        }
        ?>
	<div><?php 
        echo smarty_function_eval(array('var' => $this->_tpl_vars['section']->getContent()), $this);
        ?>
</div>
	<?php 
        if ($this->_foreach['sections']['total'] > 1) {
            ?>
		<?php 
            if (!($this->_foreach['sections']['iteration'] <= 1)) {
                ?>
<div style="text-align:right;"><a href="#top" class="action"><?php 
                echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "common.top"), $this);
                ?>
</a></div><?php 
            }
            ?>
		<?php 
开发者ID:EreminDm,项目名称:water-cao,代码行数:31,代码来源:%%D1^D16^D164455C%%topic.tpl.php

示例13: smarty_function_eval

          <input type="button" name="delete" value="<?php 
    echo $this->_tpl_vars['LANG']['word_delete'];
    ?>
" class="red" onclick="return ms.delete_submission(<?php 
    echo $this->_tpl_vars['submission_id'];
    ?>
, 'submissions.php')"/>
        <?php 
}
?>
        <?php 
if ($this->_tpl_vars['view_info']['may_add_submissions'] == 'yes') {
    ?>
          <span class="button_separator">|</span>
          <input type="button" value="<?php 
    echo smarty_function_eval(array('var' => $this->_tpl_vars['form_info']['add_submission_button_label']), $this);
    ?>
" onclick="window.location='submissions.php?form_id=<?php 
    echo $this->_tpl_vars['form_id'];
    ?>
&add_submission'" />
        <?php 
}
?>
      </div>
    </form>

    <?php 
if (count($this->_tpl_vars['tabs']) > 0) {
    ?>
      <?php 
开发者ID:jeffthestampede,项目名称:excelsior,代码行数:31,代码来源:%%F9^F96^F96E464C%%edit_submission.tpl.php

示例14: smarty_function_eval

        <?php 
            $this->assign('views', $this->_tpl_vars['curr_group_info']['views']);
            ?>

        <div class="sortable_group">
          <div class="sortable_group_header">
            <div class="sort"></div>
            <label><?php 
            echo $this->_tpl_vars['LANG']['phrase_view_group'];
            ?>
</label>
            <input type="text" name="group_name_<?php 
            echo $this->_tpl_vars['group_info']['group_id'];
            ?>
" class="group_name" value="<?php 
            echo smarty_function_eval(array('var' => $this->_tpl_vars['group_info']['group_name']), $this);
            ?>
" />
            <div class="delete_group"></div>
            <input type="hidden" class="group_order" value="<?php 
            echo $this->_tpl_vars['group_info']['group_id'];
            ?>
" />
            <div class="clear"></div>
          </div>

          <div class="sortable groupable view_list">
            <ul class="header_row">
              <li class="col0"> </li>
              <li class="col1"><?php 
            echo $this->_tpl_vars['LANG']['word_order'];
开发者ID:jeffthestampede,项目名称:excelsior,代码行数:31,代码来源:%%5C^5C5^5C530AF3%%tab_views.tpl.php

示例15: smarty_function_eval

}
?>

    <?php 
if ($this->_tpl_vars['template_option']['show_pagination'] == 'true' && $this->_tpl_vars['footer_totalPages'] > 1) {
    ?>
        <div class="pagination">
            <?php 
    echo smarty_function_eval(array('var' => $this->_tpl_vars['footer_currentPage'] - 3, 'assign' => 'paginationStartPage'), $this);
    ?>

            <?php 
    if ($this->_tpl_vars['footer_currentPage'] + 3 > $this->_tpl_vars['footer_totalPages']) {
        ?>
                <?php 
        echo smarty_function_eval(array('var' => $this->_tpl_vars['footer_totalPages'] - 6, 'assign' => 'paginationStartPage'), $this);
        ?>

            <?php 
    }
    ?>
            <?php 
    if ($this->_tpl_vars['paginationStartPage'] <= 0) {
        ?>
                <?php 
        $this->assign('paginationStartPage', '1');
        ?>
            <?php 
    }
    ?>
            <?php 
开发者ID:Juuro,项目名称:Dreamapp-Website,代码行数:31,代码来源:bulletproof^%%FA^FA8^FA860093%%entries.tpl.php


注:本文中的smarty_function_eval函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。