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


PHP Calendar::event方法代码示例

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


在下文中一共展示了Calendar::event方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: index

 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function index(Request $request)
 {
     $titulo = "Calendario";
     $cursillos = Cursillos::getCalendarCursillos($request);
     $anyos = Cursillos::getAnyoCursillosList();
     //Obtenemos los parámetros de la respuesta
     $year = $request->input('anyo');
     $week = $request->input('semana') > 0 ? $request->input('semana') : 1;
     $semanas = array();
     //A partir del número de semana obtenemos el mes
     if ($year > 0 && $week > 0) {
         $month = new \DateTime();
         $month->setISODate($year, $week);
         $mes = $month->format('m');
         $year = $month->format('Y');
     }
     $date = $year > 0 ? date('Y-m-d', strtotime("{$year}-{$mes}-1")) : date('Y-m-d');
     //Cargamos los cursillos
     foreach ($cursillos as $cursillo) {
         $event[] = \Calendar::event($cursillo->comunidad, $cursillo->cursillo, true, $cursillo->fecha_inicio, date('Y-m-d', strtotime($cursillo->fecha_final) + 86400), $cursillo->colorFondo, $cursillo->colorTexto, $cursillo->id);
     }
     if (count($cursillos) > 0) {
         $calendar = \Calendar::addEvents($event)->setOptions(['lang' => '', 'defaultDate' => $date, 'buttonIcons' => true, 'editable' => false, 'weekNumbers' => true, 'eventLimit' => true, 'header' => array('left' => 'prev', 'center' => 'title', 'right' => 'next')])->setCallbacks(['eventClick' => 'function(calEvent, jsEvent, view) {
                 $(this).attr("href","curso/"+calEvent.id);
             }']);
     }
     return view('autenticado', compact('calendar', 'anyos', 'semanas', 'titulo'));
 }
开发者ID:antoniobec,项目名称:palencia,代码行数:33,代码来源:AutenticadoController.php

示例4: index

 public function index()
 {
     //code should be inside a method
     $events[] = \Calendar::event('Event One', false, '2015-06-05T0800', '2015-06-05T0800', 0);
     $eloquentEvent = EventModel::first();
     //EventModel implements MaddHatter\LaravelFullcalendar\Event
     $calendar = \Calendar::addEvents($events)->setOptions(['firstDay' => 1])->setCallbacks(['viewRender' => 'function() {alert("Callbacks!");}']);
     return view('pages.calendar', compact('calendar'));
 }
开发者ID:rowlin,项目名称:laravel-project-calendar,代码行数:9,代码来源:CalendarController.php

示例5: 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

示例6: while

    ?>
				</header>
				<?php 
    the_content();
    ?>
			</article>
			<div class="sp-calendar-events">
				<?php 
    if ($calendar->embed_type) {
        // embed a grid view
        echo $calendar->embed_code();
    } else {
        $calendar->get_events();
        if ($calendar->style) {
            // event view
            while ($item = $calendar->event()) {
                ?>
								<article>
									<div class="sp-event-container">
										<header>
											<h2><a href="<?php 
                echo esc_url($item->get_permalink());
                ?>
" rel="bookmark"><?php 
                echo esc_html($item->title);
                ?>
</a></h2>
										</header>
										<p class="icon-clock">
											<time>
												<?php 
开发者ID:ajgamble-milner,项目名称:scoutwp-plugin,代码行数:31,代码来源:single-calendar.php

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

示例8: mktime

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

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