本文整理匯總了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"));