當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CTemplate::Render方法代碼示例

本文整理匯總了PHP中CTemplate::Render方法的典型用法代碼示例。如果您正苦於以下問題:PHP CTemplate::Render方法的具體用法?PHP CTemplate::Render怎麽用?PHP CTemplate::Render使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CTemplate的用法示例。


在下文中一共展示了CTemplate::Render方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: LogLangSettings

        LogLangSettings();
    }
} else {
    // If no phrase was submitted, show
    //   usage information, news, etc. .
    $page = new CTemplate(GetLocalizedFname('tpl/intro.html'));
}
// If we don't have data from the form or a
//   previous phrase stored in the sessions,
//   load the example data.
if (!isset($_SESSION['data'])) {
    $_SESSION['data'] = file_get_contents(GetLocalizedFname("var/sample.phrase"));
    $_SESSION['color'] = TRUE;
    $_SESSION['antialias'] = TRUE;
    $_SESSION['autosub'] = TRUE;
    $_SESSION['triangles'] = TRUE;
    $_SESSION['fontsel'] = "vera_sans";
    $_SESSION['font'] = "Vera.ttf";
    $_SESSION['fontsize'] = 8;
}
// Render the page
$phrase = htmlentities($_SESSION['data']);
$img = sprintf("<img src=\"stgraph.png.php?%s\" alt=\"\" title=\"%s\"/>", SID, $phrase);
$graph = sprintf("<a href=\"dnlgraph.php?%s\">%s</a>", SID, $img);
$icon = "<img src=\"img/vectorgfx.png\" alt=\"SVG\" />";
$svg = sprintf("<div id=\"svg\"><a href=\"stgraph.svg.php?%s\">%s</a></div>", SID, $icon);
$fontoption = sprintf("SELECT_%s", $_SESSION['fontsel']);
$sizeoption = sprintf("SELECT_size_%d", $_SESSION['fontsize']);
$page->SetValues(array('VERSION' => VERSION, 'FORM_ACTION' => sprintf("?%s", strip_tags(SID)), 'GRAPH' => $graph, 'SVG' => $svg, 'PHRASE' => $phrase, 'DATA_VAL' => $phrase, 'COLOR_VAL' => $_SESSION['color'] ? HTML_CHECKED : HTML_UNCHECKED, 'ANTIALIAS_VAL' => $_SESSION['antialias'] ? HTML_CHECKED : HTML_UNCHECKED, 'AUTOSUB_VAL' => $_SESSION['autosub'] ? HTML_CHECKED : HTML_UNCHECKED, 'TRIANGLES_VAL' => $_SESSION['triangles'] ? HTML_CHECKED : HTML_UNCHECKED, 'COUNTER' => GetCounter(), $fontoption => HTML_SELECTED, $sizeoption => HTML_SELECTED));
$page->Render();
開發者ID:ratan203,項目名稱:phpsyntaxtree,代碼行數:30,代碼來源:index.php


注:本文中的CTemplate::Render方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。