本文整理汇总了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;
}
示例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: 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'));
}
示例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'));
}
示例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();
}
示例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
示例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>";
示例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();
示例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();
}