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


PHP Calendar::render方法代码示例

本文整理汇总了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;
 }
开发者ID:hemsinfotech,项目名称:kodelearn,代码行数:33,代码来源:calendar.php

示例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);
 }
开发者ID:antpaw,项目名称:kohana_calendar,代码行数:7,代码来源:usage-example.php

示例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();
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:7,代码来源:examples.php

示例4: calendar

 function calendar()
 {
     $profiler = new Profiler();
     $cal = new Calendar(5, 2007);
     echo $cal->render();
 }
开发者ID:nicka1711,项目名称:hanami,代码行数:6,代码来源:examples.php

示例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();
开发者ID:Nilpo,项目名称:sspc-website,代码行数:31,代码来源:index.php

示例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>";
开发者ID:Okat,项目名称:gallery3-contrib,代码行数:31,代码来源:calendarview_year.html.php

示例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();
 }
开发者ID:enormego,项目名称:EightPHP,代码行数:7,代码来源:examples.php


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