本文整理汇总了PHP中Calendar::render方法的典型用法代码示例。如果您正苦于以下问题:PHP Calendar::render方法的具体用法?PHP Calendar::render怎么用?PHP Calendar::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Calendar
的用法示例。
在下文中一共展示了Calendar::render方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_calendar
public function action_calendar()
{
$view = View::factory('calendar/calendar')->bind('calendar', $calendar_markup);
$month = Arr::get($_GET, 'month', date('m'));
$year = Arr::get($_GET, 'year', date('Y'));
$event_type = Arr::get($_GET, 'event_type');
$calendar = new Calendar($month, $year);
$calendar->standard('prev-next');
$event = Model_Event::monthly_events($month, $year, $event_type);
$day_events = array();
// loop though events and group events by day and event types
foreach ($event as $e) {
$day = date('j-m', $e->eventstart);
if (!isset($day_events[$day][$e->eventtype])) {
$day_events[$day][$e->eventtype] = array();
}
$day_events[$day][$e->eventtype][] = array('id' => $e->id);
}
if ($day_events) {
foreach ($day_events as $daymonth => $types) {
list($day, $month) = explode("-", $daymonth);
$timestamp = mktime(0, 0, 0, $month, (int) $day, $year);
foreach ($types as $type => $events) {
$count = count($events);
$type = $count > 1 ? Inflector::plural($type) : $type;
$calendar->attach($calendar->event()->condition('timestamp', (int) $timestamp)->output($count . ' ' . $type));
}
}
}
$calendar->attach($calendar->event()->condition('timestamp', time())->add_class('today'));
$calendar_markup = $calendar->render();
$this->content = $view;
}
示例2: action_index
public function action_index()
{
$calendar = new Calendar(Arr::get($_GET, 'month', date('m')), Arr::get($_GET, 'year', date('Y')));
$calendar->attach($calendar->event()->condition('timestamp', time())->output(html::anchor('http://google.de', 'google')));
$data = array('content' => $calendar->render());
$this->request->response = new View('index', $data);
}
示例3: calendar
function calendar()
{
$profiler = new Profiler();
$calendar = new Calendar($this->input->get('month', date('m')), $this->input->get('year', date('Y')));
$calendar->attach($calendar->event()->condition('year', 2008)->condition('month', 8)->condition('day', 8)->output(html::anchor('http://forum.kohanaphp.com/comments.php?DiscussionID=275', 'Learning about Kohana Calendar')));
echo $calendar->render();
}
示例4: calendar
function calendar()
{
$profiler = new Profiler();
$cal = new Calendar(5, 2007);
echo $cal->render();
}
示例5: elseif
if ($month == 1) {
$prev_month = 12;
$prev_year = $year - 1;
$next_month = 2;
$next_year = $year;
} elseif ($month == 12) {
$prev_month = 11;
$prev_year = $year;
$next_month = 1;
$next_year = $year + 1;
} else {
$prev_month = $month - 1;
$prev_year = $year;
$next_month = $month + 1;
$next_year = $year;
}
$page->content .= '<div class="graybg small">' . "\n";
$page->content .= ' <div class="left"><a href="?year=' . $prev_year . '&month=' . $prev_month . '">[Previous]</a></div>' . "\n";
$page->content .= ' <div class="right"><a href="?year=' . $next_year . '&month=' . $next_month . '">[Next]</a></div>' . "\n";
$page->content .= '</div>' . "\n";
$page->content .= $c->render($c->year, $c->month);
$page->content .= '<div class="graybg small">' . "\n";
$page->content .= ' <div class="left"><a href="?year=' . $prev_year . '&month=' . $prev_month . '">[Previous]</a></div>' . "\n";
$page->content .= ' <div class="right"><a href="?year=' . $next_year . '&month=' . $next_month . '">[Next]</a></div>' . "\n";
$page->content .= '</div>' . "\n";
if ($_SESSION['login']) {
$page->content .= "<div class=\"graybg small\">\n";
$page->content .= "[<a href=\"event/index.php?action=add\">Add an Event</a>]\n";
$page->content .= "</div>\n";
}
$page->display();
示例6: mktime
if ($calendar_user == "-1") {
$month_count = ORM::factory("item")->viewable()->where("type", "!=", "album")->where("captured", ">=", mktime(0, 0, 0, $counter_months, 1, $calendar_year))->where("captured", "<", mktime(0, 0, 0, 1, 1, $calendar_year + 1))->find_all()->count();
} else {
$month_count = ORM::factory("item")->viewable()->where("owner_id", "=", $calendar_user)->where("type", "!=", "album")->where("captured", ">=", mktime(0, 0, 0, $counter_months, 1, $calendar_year))->where("captured", "<", mktime(0, 0, 0, 1, 1, $calendar_year + 1))->find_all()->count();
}
if ($month_count > 0) {
$curr_day = 1;
$MAX_DAYS = date('t', mktime(00, 00, 00, $counter_months, 1, $calendar_year));
while ($curr_day < $MAX_DAYS) {
if ($calendar_user == "-1") {
$day_count = ORM::factory("item")->viewable()->where("type", "!=", "album")->where("captured", ">=", mktime(0, 0, 0, $counter_months, $curr_day, $calendar_year))->where("captured", "<", mktime(0, 0, 0, $counter_months, $curr_day + 1, $calendar_year))->find_all()->count();
} else {
$day_count = ORM::factory("item")->viewable()->where("owner_id", "=", $calendar_user)->where("type", "!=", "album")->where("captured", ">=", mktime(0, 0, 0, $counter_months, $curr_day, $calendar_year))->where("captured", "<", mktime(0, 0, 0, $counter_months, $curr_day + 1, $calendar_year))->find_all()->count();
}
if ($day_count > 0) {
$calendar->attach($calendar->event()->condition('year', $calendar_year)->condition('month', $counter_months)->condition('day', $curr_day)->output(html::anchor(url::site("calendarview/day/" . $calendar_year . "/" . $calendar_user . "/" . $counter_months . "/" . $curr_day), $day_count)));
}
$curr_day++;
}
if ($calendar_user == "-1") {
$day_count = ORM::factory("item")->viewable()->where("type", "!=", "album")->where("captured", ">=", mktime(0, 0, 0, $counter_months, $MAX_DAYS, $calendar_year))->where("captured", "<", mktime(0, 0, 0, 1, 1, $calendar_year + 1))->find_all()->count();
} else {
$day_count = ORM::factory("item")->viewable()->where("owner_id", "=", $calendar_user)->where("type", "!=", "album")->where("captured", ">=", mktime(0, 0, 0, $counter_months, $MAX_DAYS, $calendar_year))->where("captured", "<", mktime(0, 0, 0, 1, 1, $calendar_year + 1))->find_all()->count();
}
if ($day_count > 0) {
$calendar->attach($calendar->event()->condition('year', $calendar_year)->condition('month', $counter_months)->condition('day', $MAX_DAYS)->output(html::anchor(url::site("calendarview/day/" . $calendar_year . "/" . $calendar_user . "/" . $counter_months . "/" . $MAX_DAYS), $day_count)));
}
}
$counter_months++;
echo $calendar->render();
print "</td></tr></table>";
示例7: calendar
function calendar()
{
$profiler = new Profiler();
$calendar = new Calendar($this->input->get('month', date('m')), $this->input->get('year', date('Y')));
$calendar->attach($calendar->event()->condition('year', 2008)->condition('month', 8)->condition('day', 8)->output());
echo $calendar->render();
}