本文整理汇总了PHP中Tpl::setdir方法的典型用法代码示例。如果您正苦于以下问题:PHP Tpl::setdir方法的具体用法?PHP Tpl::setdir怎么用?PHP Tpl::setdir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tpl
的用法示例。
在下文中一共展示了Tpl::setdir方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
Language::read("common");
Language::read("microshop");
if (c("microshop_isuse") != "1") {
header("location: " . SiteUrl);
exit;
}
Tpl::setdir("default");
self::cp();
Tpl::setlayout("microshop_layout");
if ($_GET['column'] && strtoupper(CHARSET) == "GBK") {
$GLOBALS['_GET'] = Language::getgbk($_GET);
}
Tpl::output("nav_list", ($nav = f("nav")) ? $nav : h("nav", TRUE, "file"));
$search_type = array();
$search_type['goods'] = Language::get("nc_microshop_goods");
$search_type['personal'] = Language::get("nc_microshop_personal");
$search_type['store'] = Language::get("nc_microshop_store");
Tpl::output("search_type", $search_type);
if (!empty($_SESSION['member_id']) || 0 < intval($_SESSION['member_id'])) {
self::get_member_avatar($_SESSION['member_id']);
}
if (!c("site_status")) {
halt(c("closed_reason"));
}
Tpl::output("html_title", Language::get("nc_microshop") . "-" . c("site_name"));
Tpl::output("seo_keywords", c("microshop_seo_keywords"));
Tpl::output("seo_description", c("microshop_seo_description"));
$this->queryCart();
}
示例2: showMessage
function showMessage($msg, $url = "", $show_type = "html", $msg_type = "succ", $is_show = 1, $time = 2000)
{
Language::read("core_lang_index");
$lang = Language::getlangcontent();
$url = $url != "" ? $url : getreferer();
$msg_type = in_array($msg_type, array("succ", "error")) ? $msg_type : "error";
switch ($show_type) {
case "json":
$return = "{";
$return .= "\"msg\":\"" . $msg . "\",";
$return .= "\"url\":\"" . $url . "\"";
$return .= "}";
echo $return;
exit;
case "exception":
echo "<!DOCTYPE html><html><head>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=" . CHARSET . "\" />";
echo "<title>" . SiteUrl . "</title>";
echo "<style type=\"text/css\">body { font-family: \"Verdana\";padding: 0; margin: 0;}h2 { font-size: 12px; line-height: 30px; border-bottom: 1px dashed #CCC; padding-bottom: 8px;width:800px; margin: 20px 0 0 150px;}dl { float: left; display: inline; clear: both; padding: 0; margin: 10px 20px 20px 150px;}dt { font-size: 14px; font-weight: bold; line-height: 40px; color: #333; padding: 0; margin: 0; border-width: 0px;}dd { font-size: 12px; line-height: 40px; color: #333; padding: 0px; margin:0;}</style></head><body>";
echo "<h2>" . $lang['error_info'] . "</h2>";
echo "<dl>";
echo "<dd>" . $msg . "</dd>";
echo "<dt><p /></dt>";
echo "<dd>" . $lang['error_notice_operate'] . "</dd>";
echo "<dd><p /><p /><p /><p /></dd>";
echo "<dd><p /><p /><p /><p />Copyright 2007-2013 , All Rights Reserved " . $lang['company_name'] . "</dd>";
echo "</dl></body></html>";
exit;
case "javascript":
echo "<script>";
echo "alert('" . $msg . "');";
echo "location.href='" . $url . "'";
echo "</script>";
exit;
case "tenpay":
echo "<html><head><meta name=\"TENCENT_ONLINE_PAYMENT\" content=\"China TENCENT\"><script language=\"javascript\">";
echo "window.location.href='" . $url . "';";
echo "</script></head><body></body></html>";
exit;
}
if (is_array($url)) {
foreach ($url as $k => $v) {
$url[$k]['url'] = $v['url'] ? $v['url'] : getreferer();
}
}
Language::read("msg");
Tpl::setdir("");
Tpl::output("html_title", Language::get("nc_html_title"));
Tpl::output("msg", $msg);
Tpl::output("url", $url);
Tpl::output("msg_type", $msg_type);
Tpl::output("is_show", $is_show);
Tpl::showpage("msg", "msg_layout", $time);
exit;
}