本文整理汇总了PHP中TPL::draw方法的典型用法代码示例。如果您正苦于以下问题:PHP TPL::draw方法的具体用法?PHP TPL::draw怎么用?PHP TPL::draw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPL
的用法示例。
在下文中一共展示了TPL::draw方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: entry
public static function entry($args) {
if( count($args) > 1 ) echo 404;
else{
$post = ModelHandler::get("Posts", array($args[0]));
$post = $post[0];
$content = ViewHandler::wrap("post", $post);
$tpl = new TPL();
$tpl->assign("content",$content);
$tpl->draw("main");
}
}
示例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: email_tpl_send
/**
* Send an email with selected template
*/
function email_tpl_send($template = "generic/email", $to, $subject, $body, $from = null, $from_name = null, $attachment = null)
{
$tpl = new TPL();
$tpl->assign("body", $body);
$body = $tpl->draw($template, true);
return emailSend($to, $subject, $body, $from, $from_name, $attachment);
}
示例4: 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"));