本文整理匯總了PHP中app::output方法的典型用法代碼示例。如果您正苦於以下問題:PHP app::output方法的具體用法?PHP app::output怎麽用?PHP app::output使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app
的用法示例。
在下文中一共展示了app::output方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: fetch_resource
protected function fetch_resource($type_folder)
{
// debug::add_info("(".__FILE__.")<b>".__CLASS__."</b>::".__FUNCTION__."() betreten.");
$param = app::$param;
$tmpl_dir = "";
if (count($param) > 1) {
$tmpl_dir = $param[0] . "/";
$param = array_slice($param, 1);
$filename = implode("/", $param);
} else {
$filename = $param[0];
}
$content_type = $this->get_content_type($this->type);
if (file_exists(TMPL_DIR . $tmpl_dir . $this->type . "/" . $filename)) {
$real_filename = TMPL_DIR . $tmpl_dir . $this->type . "/" . $filename;
} elseif (file_exists(TMPL_DIR . "default/" . $this->type . "/" . $filename)) {
$real_filename = TMPL_DIR . "default/" . $this->type . "/" . $filename;
} else {
/**
* @TODO: ggf. default-Dateien?
*/
header("HTTP/1.0 404 Not Found");
return;
}
header("Content-Type: {$content_type}");
app::$output = file_get_contents($real_filename);
return;
}
示例2: fetch_resource
public function fetch_resource($type)
{
// debug::add_info("(".__FILE__.")<b>".__CLASS__."</b>::".__FUNCTION__."() betreten.");
$param = app::$param;
$req = app::$request;
if (!array_key_exists("playername", $req)) {
header("HTTP/1.0 404 Not Found");
return;
}
$player = $req['playername'];
$cls = "model_player" . date("Y");
$avatar = $cls::get_entry_by_playername($player);
if (is_null($avatar->avatar_mime) || $avatar->avatar_mime == "") {
header("HTTP/1.0 404 Not Found");
return;
}
header("Content-Type: " . $avatar->avatar_mime);
app::$output = stripslashes($avatar->avatar);
return;
}
示例3: fetch_resource
public function fetch_resource($type)
{
// debug::add_info("(".__FILE__.")<b>".__CLASS__."</b>::".__FUNCTION__."() betreten.");
$param = app::$param;
$req = app::$request;
if (!array_key_exists("type", $req) && !array_key_exists("month", $req)) {
header("HTTP/1.0 404 Not Found");
return;
}
$type = $req['type'];
$month = intval(date("m"));
if (array_key_exists("month", $req)) {
$month = intval($req['month']);
}
$cls = "model_award" . date("Y");
$awrd = $cls::get_entry_by_month_type($month, $type);
header("Content-Type: " . $awrd->mime);
app::$output = stripslashes($awrd->file);
return;
}