本文整理汇总了PHP中Parser::formatDate方法的典型用法代码示例。如果您正苦于以下问题:PHP Parser::formatDate方法的具体用法?PHP Parser::formatDate怎么用?PHP Parser::formatDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parser
的用法示例。
在下文中一共展示了Parser::formatDate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($k, $v)
{
switch ($k) {
case "date":
if (substr($v, 0, 8) == date("Ymd")) {
return "oggi " . Parser::formatDate($v, TIME);
} elseif (substr($v, 0, 8) == Parser::yesterday()) {
return "ieri " . Parser::formatDate($v, TIME);
} else {
return Parser::formatDate($v, STANDARD) . " " . Parser::formatDate($v, TIME);
}
break;
case "link":
if (ereg("manager", $v)) {
return "<a href=\"{$v}\">item</a>";
} else {
return "";
}
break;
default:
return beContentPager::display($k, $v);
break;
}
return $v;
}
示例2: doIt
/**
* @access public
* @param aExtrinsicState
* @ParamType aExtrinsicState
*/
public function doIt($parameters)
{
$mode_default = "NORMAL";
//EXTENDED_PLUS, LETTERS, BLOG,
/*
* Inseriamo un default nel caso non venga esplicitata "mode" della data,
* ovvero nel caso in cui venga passata SOLO la stringa "grezza" della data.
*/
if (!is_array($parameters)) {
$mode = $mode_default;
$date_to_mode = $parameters;
} else {
$mode = $parameters[1];
$date_to_mode = $parameters[0];
}
/*
* $parameters in questo caso � un array di 2 elementi
* $paremeters[0] ha la stringa in input da tagliare;
* $parameters[1] ha la quantit�, la length del taglio.
*/
return Parser::formatDate($date_to_mode, $mode);
}
示例3: formatdate
function formatdate($name, $data, $pars)
{
return Parser::formatDate($data, $pars['mode']);
}
示例4: display
function display($data)
{
$length = 400;
foreach ($data as $k => $v) {
switch ($k) {
case "body":
$this->template->setContent($k, Parser::subtext($data[$k], $length) . " ...");
break;
case "video":
if ($data[$k] != "") {
#$this->template->setContent("video","<span class=\"mediaicons\"><img src=\"img/grafica/icon_video.gif\" alt=\"Video: titolo_mainnews\"/><a href=\"javascript:openvideo('{$data['video']}','{$data['logo']}')\">video </a> </span>");
$this->template->setContent("video", "<img src=\"img/grafica/icon_video.gif\" alt=\"Video: titolo_mainnews\"/><a href=\"javascript:openvideo('{$data['video']}','{$data['logo']}')\">video </a>");
} else {
$this->template->setContent("video", "");
}
break;
case "foto":
if ($data[$k] != 0) {
$length = 250;
$this->template->setContent("foto", "<a href=\"news.php?id={$data['id']}\"><img src=\"show.php?token=3bcda8f2aed2c8f1fdea1c020dadcf39&id={$data['id']}&width=52&height=60&thumb\" alt=\"{$data['title']}\"/></a>");
} else {
$this->template->setContent("foto", "");
}
break;
case "data":
$this->template->setContent("data", Parser::formatDate($v, STANDARD_PLUS));
break;
default:
$this->template->setContent($k, $data[$k]);
break;
}
}
}