• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP parse_template函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: email_quote

function email_quote($quote_id, $quote_template, $from, $to, $subject, $body, $cc = NULL, $bcc = NULL)
{
    $CI =& get_instance();
    $CI->load->helper('mailer/phpmailer');
    $CI->load->helper('template');
    $CI->load->helper('pdf');
    $quote = generate_quote_pdf($quote_id, FALSE, $quote_template);
    $db_quote = $CI->mdl_quotes->where('ip_quotes.quote_id', $quote_id)->get()->row();
    $message = nl2br(parse_template($db_quote, $body));
    return phpmail_send($from, $to, $subject, $message, $quote, $cc, $bcc);
}
开发者ID:benoitrx85,项目名称:InvoicePlane,代码行数:11,代码来源:mailer_helper.php


示例2: cache_templates

function cache_templates($templatetitles)
{
    global $con;
    foreach ($templatetitles as $templatetitle) {
        if (!parsed_is_current($templatetitle)) {
            parse_template($templatetitle);
        }
        if (file_exists(parsedtemplatepath($templatetitle))) {
            $con->templatecache[$templatetitle] = file_get_contents(parsedtemplatepath($templatetitle));
        }
    }
}
开发者ID:ryantinker,项目名称:Construmax,代码行数:12,代码来源:functions_template.php


示例3: index

 function index()
 {
     $data = array();
     $data['page'] = 'about';
     if ($this->sg_auth->is_logged_in()) {
         $data['logged_in'] = true;
         $uuid = $this->sg_auth->get_uuid();
         $data['user_data'] = $this->simiangrid->get_user($uuid);
     } else {
         $data['logged_in'] = false;
     }
     parse_template('about', $data);
 }
开发者ID:QuillLittlefeather,项目名称:mgm-simiangrid,代码行数:13,代码来源:about.php


示例4: subtplcheck

/**
 * JETLEE
 * 与模板处理相关的辅助类
 * 
 *
 */
function subtplcheck($subfiles, $mktime, $tpl, $tplrefresh = 0)
{
    if ($tplrefresh && ($tplrefresh == 1 || mt_rand(1, $tplrefresh) == 1)) {
        $subfiles = explode('|', $subfiles);
        foreach ($subfiles as $subfile) {
            $tplfile = $subfile . '.htm';
            @($submktime = filemtime($tplfile));
            if ($submktime > $mktime) {
                include_once APPPATH . 'libraries/Template.php';
                parse_template($tpl);
                break;
            }
        }
    }
}
开发者ID:sdgdsffdsfff,项目名称:hiveAdmin,代码行数:21,代码来源:template_helper.php


示例5: email_quote

function email_quote($quote_id, $quote_template, $from, $to, $subject, $body, $cc = null, $bcc = null, $attachments = null)
{
    $CI =& get_instance();
    $CI->load->helper('mailer/phpmailer');
    $CI->load->helper('template');
    $CI->load->helper('pdf');
    $quote = generate_quote_pdf($quote_id, false, $quote_template);
    $db_quote = $CI->mdl_quotes->where('ip_quotes.quote_id', $quote_id)->get()->row();
    $message = parse_template($db_quote, $body);
    $subject = parse_template($db_quote, $subject);
    $cc = parse_template($db_quote, $cc);
    $bcc = parse_template($db_quote, $bcc);
    $from = array(parse_template($db_quote, $from[0]), parse_template($db_quote, $from[1]));
    return phpmail_send($from, $to, $subject, $message, $quote, $cc, $bcc, $attachments);
}
开发者ID:Thewafflication,项目名称:InvoicePlane,代码行数:15,代码来源:mailer_helper.php


示例6: select_html

 public static function select_html($selected = 0, $name = "userrole_id", $class = "select", $template = '%name%')
 {
     $roles = new UserRole();
     $roles->get_iterated();
     echo "<select name='{$name}' class='{$class}'>";
     foreach ($roles as $role) {
         if ($selected == $role->id) {
             $selstr = " selected='selected'";
         } else {
             $selstr = "";
         }
         $format = parse_template($template, $role->stored);
         echo "<option value='{$role->id}' class='user_select'{$selstr}>" . $format . "</option>\n";
     }
     echo "</select>";
 }
开发者ID:jotavejv,项目名称:CMS,代码行数:16,代码来源:userrole.php


示例7: pastebin

            $textwithlinks .= "</tr>\n";
        }
        $textwithlinks .= "</table>\n";
    }
    if ($cleantext != "" && isset($_REQUEST['pastebin'])) {
        $url = pastebin($cleantext, $name);
        $pastebin = "Pastebin url: <a href=\"{$url}\" target=\"_blank\">{$url}</a>";
    }
    $cleantext = "<h1>translated for copy and paste</h1>\n<pre>{$cleantext}</pre>";
    return array('PASTEBIN' => $pastebin, 'RESULTCLEAN' => $cleantext, 'RESULTHTML' => $textwithlinks);
}
$res['PASTEBIN'] = "";
/*initianlize vars for template*/
$res['RESULTHTML'] = "";
$res['RESULTCLEAN'] = "";
$res['TEXTAREA'] = getinfolog();
$res['TRANSLATOR'] = "http://springrts.com:8000";
$res['INFO'] = "";
if ($res['TEXTAREA'] != "") {
    limit();
    $tmp = xmlrpcrequest($res['TRANSLATOR'], $res['TEXTAREA']);
    /*	if (array_key_exists('faultString',$tmp)){
    		$res['INFO']="<h1>Warning: using local translator, as remote can't translate</h1>";
    		$res['TRANSLATOR']="http://abma.de:8000";
    		$tmp=xmlrpcrequest($res['TRANSLATOR'],$res['TEXTAREA']);
    	}*/
    $res = array_merge($res, parse_result($tmp, getVersion($res['TEXTAREA'])));
}
$res['ACTION'] = $_SERVER['SCRIPT_NAME'];
echo parse_template("index.tpl", $res);
开发者ID:renemilk,项目名称:spring,代码行数:30,代码来源:index.php


示例8: foreach

    }
}
// Display most popular comments
if (!empty($top_likes)) {
    echo "\t" . '<br><b class="cmtfont">' . $text['popular_cmts'] . ' Comment' . (count($top_likes) != '1' ? 's' : '') . ':</b>' . PHP_EOL;
    $variable = '';
    foreach ($top_likes as $file) {
        $likes_array = parse_comments($file, array(), 'no');
    }
    parse_template(array_values($likes_array), $top_cmts);
}
// Display comment count
echo "\t" . '<br><b class="cmtfont">' . $text['showing_cmts'] . ' ' . ($script = $cmt_count == "1" ? '0 Comments:</b>' . PHP_EOL : display_count() . ':</b>' . PHP_EOL);
// Display comments, if there are no comments display a note
if (!empty($show_cmt)) {
    parse_template($show_cmt, $total_count);
} else {
    echo "\t" . '<div style="margin: 16px 0px 12px 0px;" class="cmtdiv">' . PHP_EOL;
    echo "\t\t" . '<span class="cmtnumber"><img width="' . $icon_size . '" height="' . $icon_size . '" src="/img/first-comment.png"></span>' . PHP_EOL;
    echo "\t\t" . '<div style="height: ' . $icon_size . 'px;" class="cmtbubble">' . PHP_EOL;
    echo "\t\t\t" . '<b class="cmtnote cmtfont" style="color: #000000;">Be the first to comment!</b>' . PHP_EOL;
    echo "\t\t" . '</div>' . PHP_EOL;
    echo "\t" . '</div>' . PHP_EOL;
}
?>

	<br><center>
		HashOver Comments &middot;
<?php 
if (!empty($show_cmt)) {
    echo "\t\t" . '<a href="http://' . $domain . '/hashover.php?rss=' . $page_url . '" target="_blank">RSS Feed</a> &middot;' . PHP_EOL;
开发者ID:zxrlha,项目名称:whom,代码行数:31,代码来源:php-mode.php


示例9: ajax_send_email

 function ajax_send_email()
 {
     $this->form_validation->set_rules('client_name', 'client name', 'trim|required|xss_clean');
     $this->form_validation->set_rules('email_subject', 'email subject', 'trim|required|xss_clean');
     $this->form_validation->set_rules('email_template', 'email template', 'trim|required|xss_clean');
     $this->form_validation->set_rules('email_body', 'email body', 'trim|required|xss_clean');
     $this->form_validation->set_error_delimiters('<p class="has-error"><label class="control-label">', '</label></p>');
     if ($this->form_validation->run()) {
         $this->load->helper('template');
         $quote_id = $this->input->post('quote_id');
         $email_subject = $this->input->post('email_subject');
         $email_body = $this->input->post('email_body');
         $quote_data = $this->quotes_model->get_quote_details($quote_id);
         $message_body = parse_template($quote_data, $email_body);
         $quote_details = $this->quotes_model->previewquote($quote_id);
         $this->load->helper('pdf');
         $pdf_quote = generate_pdf_quote($quote_details, false, NULL);
         $to = $quote_data->client_email;
         if (send_email($email_subject, $to, $message_body, $pdf_quote)) {
             $this->session->set_flashdata('success', 'The quote has been emailed successfully !!');
             $response = array('success' => 1);
         } else {
             $response = array('success' => 0, 'errormsg' => 'Please set the company name and the company email in system settings first !!');
         }
     } else {
         $this->load->helper('json_error');
         $response = array('success' => 0, 'validation_errors' => json_errors());
     }
     echo json_encode($response);
 }
开发者ID:anji12172,项目名称:finalProject,代码行数:30,代码来源:quotes.php


示例10: normale

/**********************/
/***********************/
/* PAGE CREATION       */
/***********************/
/*
 choix du template principal :
 page normale (par defaut), pop-up ou page pour impression
*/
if (eregi("fen_pop", $_SERVER['QUERY_STRING'])) {
    $page['fen'] = "pop";
}
if (eregi("fen_impression", $_SERVER['QUERY_STRING'])) {
    $page['fen'] = "impression";
}
if (isset($page['fen']) and $page['fen'] == "pop") {
    $template = $tpl['general']['pop'];
    $html_code = parse_template(TPL_URL . $template, $index);
} elseif (isset($_GET['fen']) and $_GET['fen'] == "pop") {
    $template = $tpl['general']['pop'];
    $html_code = parse_template(TPL_URL . $template, $index);
} elseif (isset($page['fen']) and $page['fen'] == "ajax") {
    $html_code = $index['contenu'];
} elseif (isset($page['fen']) and $page['fen'] == "impression") {
    $template = $tpl['general']['imprime'];
    $html_code = parse_template(TPL_URL . $template, $index);
} else {
    $template = $tpl['general']['index'];
    $html_code = parse_template(TPL_URL . $template, $index);
}
echo $html_code;
/***********************/
开发者ID:jkreska,项目名称:test1,代码行数:31,代码来源:index.php


示例11: elseif

$parse_main['{width_preview_elements}'] = '';
$parse_main['{height_preview_elements}'] = '';
if (isset($config['width_preview_elements']) and $config['width_preview_elements'] != '') {
    $parse_main['{width_preview_elements}'] = 'value="' . $config['width_preview_elements'] . '" ';
} elseif (isset($config['height_preview_elements']) and $config['height_preview_elements'] != '') {
    $parse_main['{height_preview_elements}'] = 'value="' . $config['height_preview_elements'] . '" ';
}
if (isset($error) and is_array($error)) {
    $parse_main['{error}'] = parse_template(get_template('info'), array("{type}" => 'error', "{title}" => "Ошибка!", "{text}" => implode("<br />", $error)));
} else {
    $parse_main['{error}'] = '';
}
$cachefile = $config['cachefile'];
if (!file_exists($cachefile) or time() - @filemtime($cachefile) > $config['cache_time']) {
    touch($cachefile);
    //чтобы только один пользователь запускал подсчет
    list($size, $images_total, $images_h24) = get_dir_size($config['uploaddir']);
    $size = formatfilesize($size);
    file_put_contents($cachefile, "{$images_total}|{$size}|{$images_h24}");
} elseif (file_exists($cachefile)) {
    list($images_total, $size, $images_h24) = explode("|", file_get_contents($cachefile));
}
$parse_main['{size}'] = $size;
$parse_main['{images}'] = $images_total;
$parse_main['{images24}'] = $images_h24;
$parse_main['{site_http_path}'] = $config['site_url'];
if (!$parse_main['{content}']) {
    $parse_main['{content}'] = '';
}
echo parse_template(get_template('index'), $parse_main);
开发者ID:feeel1,项目名称:akina,代码行数:30,代码来源:index.php


示例12: template

function template($file, $language = 'templates')
{
    global $tplrefresh, $tpldir, $styleid, $timestamp;
    $tpldir = $tpldir ? $tpldir : 'templates/default';
    $templateid = $styleid ? $styleid : 1;
    $tplfile = CYASK_ROOT . './' . $tpldir . '/' . $file . '.html';
    $objfile = CYASK_ROOT . './askdata/templates/' . $templateid . '_' . $file . '.tpl.php';
    if ($tplrefresh == 1 || $tplrefresh > 1 && substr($timestamp, -1) > $tplrefresh) {
        if (@filemtime($tplfile) > @filemtime($objfile)) {
            require_once CYASK_ROOT . './include/template.func.php';
            parse_template($file, $language, $tpldir, $templateid);
        }
    }
    return $objfile;
}
开发者ID:yunsite,项目名称:cyaskuc,代码行数:15,代码来源:global.func.php


示例13: index

 function index()
 {
     $data = array();
     $data['page'] = 'about';
     parse_template('about', $data);
 }
开发者ID:ronfesta,项目名称:simiangrid,代码行数:6,代码来源:about.php


示例14: template

function template($tplfile, $fullpath = 0)
{
    global $_SCONFIG;
    if (empty($fullpath)) {
        $filename = 'templates/' . $_SCONFIG['template'] . '/' . $tplfile . '.html.php';
        $objfile = S_ROOT . './cache/tpl/tpl_' . $_SCONFIG['template'] . '_' . $tplfile . '.php';
        $tplfile = S_ROOT . './' . $filename;
    } else {
        $filename = $tplfile;
        $objfile = str_replace('/', '_', $filename);
        $objfile = S_ROOT . './cache/tpl/tpl_' . $objfile . '.php';
        $tplfile = S_ROOT . './' . $filename;
    }
    $tplrefresh = 1;
    if (file_exists($objfile)) {
        if (empty($_SCONFIG['tplrefresh'])) {
            $tplrefresh = 0;
        } else {
            if (@filemtime($tplfile) <= @filemtime($objfile)) {
                $tplrefresh = 0;
            }
        }
    }
    if ($tplrefresh) {
        include_once S_ROOT . './function/template.func.php';
        parse_template($tplfile, $objfile);
    }
    return $objfile;
}
开发者ID:hongz1125,项目名称:devil,代码行数:29,代码来源:common.func.php


示例15: template

function template($file, $tpldir = '')
{
    global $setting;
    $tpldir = '' == $tpldir ? $setting['tpl_dir'] : $tpldir;
    $tplfile = TIPASK_ROOT . '/view/' . $tpldir . '/' . $file . '.html';
    $objfile = TIPASK_ROOT . '/data/view/' . $tpldir . '_' . $file . '.tpl.php';
    if ('default' != $tpldir && !is_file($tplfile)) {
        $tplfile = TIPASK_ROOT . '/view/default/' . $file . '.html';
        $objfile = TIPASK_ROOT . '/data/view/default_' . $file . '.tpl.php';
    }
    if (!file_exists($objfile) || @filemtime($tplfile) > @filemtime($objfile)) {
        require_once TIPASK_ROOT . '/lib/template.func.php';
        parse_template($tplfile, $objfile);
    }
    return $objfile;
}
开发者ID:eappl,项目名称:prototype,代码行数:16,代码来源:global.func.php


示例16: send

 /**
  * @param $id
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function send($id)
 {
     $invoice = $this->invoice->with('items', 'client')->getById($id);
     if ($invoice) {
         $settings = $this->setting->first();
         $invoiceSettings = $this->invoiceSetting->first();
         $invoice->totals = $this->invoice->invoiceTotals($id);
         $pdf = \PDF::loadView('invoices.pdf', compact('settings', 'invoice', 'invoiceSettings'));
         $data['emailBody'] = 'An invoice has been generated';
         $data['emailTitle'] = 'An invoice has been generated';
         $template = $this->template->where('name', 'invoice')->first();
         if ($template) {
             $data_object = new \stdClass();
             $data_object->invoice = $invoice;
             $data_object->settings = $settings;
             $data_object->client = $invoice->client;
             $data['emailBody'] = parse_template($data_object, $template->body);
             $data['emailTitle'] = $template->subject;
         }
         $data['logo'] = $settings->logo;
         \Mail::send(['html' => 'emails.layout'], $data, function ($message) use($pdf, $invoice, $settings) {
             $message->sender($settings->email, $settings->name);
             $message->to($invoice->client->email, $invoice->client->name);
             $message->subject('Invoice Generated');
             $message->attachData($pdf->output(), 'invoice_' . $invoice->number . '_' . date('Y-m-d') . '.pdf');
         });
         \Flash::success('Invoice has been emailed to the client');
     }
     return redirect('invoices');
 }
开发者ID:edouardkombo,项目名称:spinv,代码行数:34,代码来源:InvoicesController.php


示例17: db_connect

<?php

// Basic script that builds the entire page from the templates
// Standard includes
include "admin/config.php";
include "{$site_root}/libs/lib_db.php";
include "{$site_root}/libs/lib_templates.php";
include "{$site_root}/libs/lib_html.php";
// Log page access in database
include "{$site_root}/logging/inc_logger.php";
// Connect to database
$links_id = db_connect("mtbwales");
// ----------------------------------------------------------------
// Page code starts below
// ----------------------------------------------------------------
$html = "";
// ----------------------------------------------------------------
// Page code ends above
// ----------------------------------------------------------------
// Format any HTML that we created
if (!empty($html)) {
    $html = pretty_html($html);
}
// Create local templates for the page
create_local_template("nav_bar", "");
create_local_template("content_area", $html);
// Define the content of the page and then display it to the browser
parse_template("<tpl>whole_page</tpl>", $site_id);
开发者ID:BackupTheBerlios,项目名称:myphpcms,代码行数:28,代码来源:index.php


示例18: parse_template_file

function parse_template_file($filename)
{
    return parse_template(file_get_contents($filename));
}
开发者ID:JoshuaGrams,项目名称:wfpl,代码行数:4,代码来源:template.php


示例19: preg_replace

    //если картинка одна - нафиг мульти
    if (isset($bb_img_arr)) {
        if (count($bb_img_arr) < 2) {
            $view_one_template = preg_replace("/\\[multi_img\\](.*?)\\[\\/multi_img\\]/isu", '', $view_one_template);
        } else {
            $view_summary_template = get_template('view_summary');
            $parse_multi_img['{multi_pages}'] = implode("\n", $page_img_arr);
            $parse_multi_img['{multi_img}'] = implode("\n", $direct_img_arr);
            $parse_multi_img['{multi_bb_img}'] = implode("\n", $bb_img_arr);
            $parse_multi_img['{multi_html_img}'] = implode("\n", $html_img_arr);
            if (count($bb_prev_and_img_arr) > 1) {
                $parse_multi_img['{multi_bb_prev_and_img}'] = implode(' ', $bb_prev_and_img_arr);
                $parse_multi_img['{multi_html_prev_and_img}'] = implode(' ', $html_prev_and_img_arr);
                $parse_multi_img['[multi_img_prev]'] = '';
                $parse_multi_img['[/multi_img_prev]'] = '';
            } else {
                preg_match("/\\[multi_img_prev\\](.*?)\\[\\/multi_img_prev\\]/isu", $view_summary_template, $multi_img_prev_out);
                $parse_multi_img[$multi_img_prev_out['0']] = '';
            }
            $parse_main['{content}'] .= parse_template($view_summary_template, $parse_multi_img);
        }
    }
} else {
    $parse_main['{content}'] = '';
    if (isset($_REQUEST['v']) and $_REQUEST['v']) {
        header('HTTP/1.0 404 Not Found');
        $error[] = 'Изображение не найдено.';
    } else {
        $error[] = 'Ошибка загрузки изображения.';
    }
}
开发者ID:feeel1,项目名称:akina,代码行数:31,代码来源:view.php


示例20: htmlspecialchars

        echo '</div>';
    }
} else {
    ?>
                        <div style="font-size:0.7em; float:right">
                            <a href="<?php 
    echo SITE;
    ?>
/index.php?a=edit&q=<?php 
    echo htmlspecialchars($url);
    ?>
" style="color:white">编辑</a>
                        </div>
                    <?php 
    echo '<div style="padding-right:1em">';
    echo parse_link(parse_template($content));
    if ($special) {
        require __DIR__ . '/special.php';
    }
    echo '</div>';
}
?>
                </td>
            </tr>
            <tr style="height:0">
                <td style="height:0">
                    <footer>符文工房中文百科的全部文字在<a href="https://creativecommons.org/licenses/by-sa/3.0/deed.zh">知识共享 署名-相同方式共享 3.0</a>协议之条款下提供。</footer>
                </td>
            </tr>
        </table>
    </body>
开发者ID:SnowyYANG,项目名称:SWiki,代码行数:31,代码来源:index.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP parse_textarea函数代码示例发布时间:2022-05-15
下一篇:
PHP parse_str函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap