本文整理汇总了PHP中TPL::check_template方法的典型用法代码示例。如果您正苦于以下问题:PHP TPL::check_template方法的具体用法?PHP TPL::check_template怎么用?PHP TPL::check_template使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPL
的用法示例。
在下文中一共展示了TPL::check_template方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
include FOLDER_WEBAPP . "services" . DS . "service_minify.php";
// service SITEMAP
include FOLDER_WEBAPP . "services" . DS . "service_sitemap.php";
// service THUMBS
include FOLDER_WEBAPP . "services" . DS . "service_thumbs.php";
URL::route("/", function () {
TPL::render("pages/page_home");
});
if (CONTENT::is_page()) {
TPL::thing("head", "title", CONTENT::$current['content_title']);
EVENTS::add_action("view_page_page_text", function () {
TPL::assign("content", CONTENT::get());
TPL::render("pages/page_text");
});
EVENTS::add_action("before_render", function () {
EVENTS::do_action("view_page_" . CONTENT::get("content_type"));
});
URL::routed(true);
}
if (!URL::routed()) {
$request = URL::get_request();
if (substr($request, -1) == '/') {
$request = substr($request, 0, -1);
}
$not_allowed = array("home", "text", "404", "maintenance");
if (TPL::check_template("page_" . $request) && !in_array($request, $not_allowed)) {
TPL::render("page_" . $request);
URL::routed(true);
}
}
//LOGS::export("html", true);
示例2: show_404
function show_404()
{
// do programmed events
EVENTS::do_action("on_error_404");
// change header status
header("HTTP/1.0 404 Not Found");
// change title if isn't setted
if (TPL::thing("head", "title") == '') {
TPL::thing("head", "title", "Error 404 | Page not found");
}
// set render and draw
if (TPL::check_template("page_404")) {
TPL::render("page_404");
TPL::draw(true);
} else {
echo "<h1>Error 404! Not found</h1>";
}
}
示例3: foreach
}
// general assign
TPL::assign("admin_url", ADMIN_URL);
TPL::assign("base_url", BASE_URL);
// run plugins
foreach (DRAWLINE::plugins_list(true) as $plugin) {
if (file_exists(FOLDER_PLUGINS . $plugin . DS . "index.php")) {
include_once FOLDER_PLUGINS . $plugin . DS . "index.php";
EVENTS::do_action("run_plugin_" . $plugin);
} else {
LOGS::write("Not found plugin " . $plugin . " on the server.");
}
}
EVENTS::do_action("before_render");
// start render
if (OPTIONS::website("maintenance_mode") == '1' && !on_admin() && !PERMISSIONS::check("access_admin")) {
if (TPL::check_template("page_maintenance")) {
TPL::render("page_maintenance");
TPL::draw(true);
} else {
echo '<h1>This website is in maintenance!</h1>';
}
} elseif (TPL::render() != "") {
TPL::draw(true);
} else {
if (!URL::routed()) {
show_404();
}
}
EVENTS::do_action("after_render");
//print_array(LOGS::export("html"));