当前位置: 首页>>代码示例>>PHP>>正文


PHP Calendar::setMonthNames方法代码示例

本文整理汇总了PHP中Calendar::setMonthNames方法的典型用法代码示例。如果您正苦于以下问题:PHP Calendar::setMonthNames方法的具体用法?PHP Calendar::setMonthNames怎么用?PHP Calendar::setMonthNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Calendar的用法示例。


在下文中一共展示了Calendar::setMonthNames方法的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");
 }
开发者ID:reboxhost,项目名称:phpb2b,代码行数:33,代码来源:news_controller.php

示例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;

	}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:30,代码来源:class.php

示例3: Newses

 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @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'])) {
开发者ID:renduples,项目名称:alibtob,代码行数:31,代码来源:index.php


注:本文中的Calendar::setMonthNames方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。