PHPackages                             funayaki/cakephp-calendar - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. funayaki/cakephp-calendar

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

funayaki/cakephp-calendar
=========================

A CakePHP plugin to easily create calendars.

0.2(8y ago)010MITPHPPHP &gt;=5.6

Since Mar 9Pushed 7y ago1 watchersCompare

[ Source](https://github.com/funayaki/cakephp-calendar)[ Packagist](https://packagist.org/packages/funayaki/cakephp-calendar)[ Docs](https://github.com/dereuromark/cakephp-calendar)[ RSS](/packages/funayaki-cakephp-calendar/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (3)Versions (4)Used By (0)

CakePHP Calendar plugin
=======================

[](#cakephp-calendar-plugin)

[![Build Status](https://camo.githubusercontent.com/caa631b034e5b49136312bcb8dcd46ba01aaf8bcada77de009ba3f19fbb69b5b/68747470733a2f2f6170692e7472617669732d63692e6f72672f6465726575726f6d61726b2f63616b657068702d63616c656e6461722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/dereuromark/cakephp-calendar)[![Latest Stable Version](https://camo.githubusercontent.com/e96afb8944f3f500620cc35510309a0bebcd348450a37a3867f9e66195c4ffca/68747470733a2f2f706f7365722e707567782e6f72672f6465726575726f6d61726b2f63616b657068702d63616c656e6461722f762f737461626c652e737667)](https://packagist.org/packages/dereuromark/cakephp-calendar)[![Minimum PHP Version](https://camo.githubusercontent.com/e97290c4047b8fc1152177fc8110cab416f31f18159b722b6b633a210a198861/687474703a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e362d3838393242462e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/6fc1909d8bd6c28f313b2f1435e28abbc71774e81784f9adb2ed74b6a54548b8/68747470733a2f2f706f7365722e707567782e6f72672f6465726575726f6d61726b2f63616b657068702d63616c656e6461722f6c6963656e73652e706e67)](https://packagist.org/packages/dereuromark/cakephp-calendar)[![Total Downloads](https://camo.githubusercontent.com/06c8501bc4bab3e0a49f84c8d8db4cc1112765e065b66d45b888eba97cdc526b/68747470733a2f2f706f7365722e707567782e6f72672f6465726575726f6d61726b2f63616b657068702d63616c656e6461722f642f746f74616c2e706e67)](https://packagist.org/packages/dereuromark/cakephp-calendar)[![Coding Standards](https://camo.githubusercontent.com/dbabe22710e675cb88cd0b12196f1477e2376dea497332775692cf1359a75918/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f63732d5053522d2d322d2d522d79656c6c6f772e737667)](https://github.com/php-fig-rectified/fig-rectified-standards)

A plugin to render simple calendars.

This branch is for CakePHP 3.5+.

Features
--------

[](#features)

- Simple and robust
- No JS needed, more responsive than solutions like fullcalendar
- Persistent `year/month` URL pieces (copy-paste and link/redirect friendly)

Demo
----

[](#demo)

See the demo [Calendar example](http://sandbox.dereuromark.de/sandbox/calendar) at the sandbox.

Setup
-----

[](#setup)

```
composer require dereuromark/cakephp-calendar

```

Then make sure the plugin is loaded in bootstrap:

```
bin/cake plugin load Calendar

```

You can also just manually put this in:

```
Plugin::load('Calendar');

```

Usage
-----

[](#usage)

Load the component in your controller:

```
$this->loadComponent('Calendar.Calendar');
```

And also your helper in the View class:

```
$this->loadHelper('Calendar.Calendar');
```

Your action:

```
	/**
	 * @param string|null $year
	 * @param string|null $month
	 * @return void
	 */
	public function calendar($year = null, $month = null) {
		$this->Calendar->init($year, $month);

		// Fetch calendar items (like events, birthdays, ...)
		$options = [
			'year' => $this->Calendar->year(),
			'month' => $this->Calendar->month(),
		];
		$events = $this->Events->find('calendar', $options);

		$this->set(compact('events'));
	}
```

In your index template:

```
