本文整理汇总了PHP中Calendar::setDayNames方法的典型用法代码示例。如果您正苦于以下问题:PHP Calendar::setDayNames方法的具体用法?PHP Calendar::setDayNames怎么用?PHP Calendar::setDayNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Calendar
的用法示例。
在下文中一共展示了Calendar::setDayNames方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
function index()
{
global $viewhelper;
require CACHE_COMMON_PATH . "cache_type.php";
$title = L("industry_info", "tpl");
//cal
require CLASS_PATH . "calendar.class.php";
$cal = new Calendar();
$cal->setMonthNames(explode(",", L("month_unit", "tpl")));
$cal->setDayNames(explode(",", L("week_unit", "tpl")));
$d = getdate(time());
$day = $_GET['day'];
if ($day == "") {
$day = $d['mday'];
}
$month = $_GET['month'];
if ($month == "") {
$month = $d["mon"];
}
$year = $_GET['year'];
if ($year == "") {
$year = $d["year"];
}
if (isset($_GET['year']) && isset($_GET['month']) && isset($_GET['day'])) {
$title .= L("journal", "tpl", $year . $month . $day);
setvar("date_line", $year . "-" . $month . "-" . $day);
}
$viewhelper->setTitle($title);
setvar("Calendar", $cal->getMonthView($month, $year));
$cache_id = $year . $month . $day;
//end cal
render("news/index");
}
示例2: calendar
/**
* возвращает календарь. хтмл.
*/
public function calendar()
{
$this->__loadLib("calendar.php");
$this->__implement("calendar");
$year = getRequest('year') ? (int) getRequest('year') : date('Y');
$month = getRequest('month') ? (int) getRequest('month') : date('m');
$calendar = new Calendar();
$lang_id = cmsController::getInstance()->getCurrentLang()->getId();
$lang = langsCollection::getInstance()->getLang($lang_id);
if ($lang->getPrefix() == "ru")
{
$calendar->setMonthNames(array("Январь", "Февраль", "Март", "Апрель", "Май", "Июнь",
"Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"));
$calendar->setDayNames(array("Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"));
$calendar->setStartDay(1);
}
$result = $calendar->getMonthView($month, $year);
return $result;
}
示例3: Newses
*
* @version $Revision: 2048 $
*/
define('CURSCRIPT', 'index');
require "../libraries/common.inc.php";
require "../share.inc.php";
require CACHE_PATH . "cache_type.php";
uses("news", "newstype");
$news = new Newses();
$newstype = new Newstypes();
$title = L("industry_info", "tpl");
//cal
require "../libraries/calendar.class.php";
$cal = new Calendar();
$cal->setMonthNames(explode(",", L("month_unit", "tpl")));
$cal->setDayNames(explode(",", L("week_unit", "tpl")));
$d = getdate(time());
$day = $_GET['day'];
if ($day == "") {
$day = $d['mday'];
}
$month = $_GET['month'];
if ($month == "") {
$month = $d["mon"];
}
$year = $_GET['year'];
if ($year == "") {
$year = $d["year"];
}
if (isset($_GET['year']) && isset($_GET['month']) && isset($_GET['day'])) {
$title .= L("journal", "tpl", $year . $month . $day);