https://github.com/solution10/calendar
Straightforward calendars, with events, for any templating system.
https://github.com/solution10/calendar
calendar composer-packages php
Last synced: about 1 year ago
JSON representation
Straightforward calendars, with events, for any templating system.
- Host: GitHub
- URL: https://github.com/solution10/calendar
- Owner: solution10
- License: mit
- Created: 2014-07-22T18:42:33.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2017-06-06T14:58:55.000Z (about 9 years ago)
- Last Synced: 2025-04-10T22:54:22.473Z (about 1 year ago)
- Topics: calendar, composer-packages, php
- Language: PHP
- Homepage: http://solution10.com
- Size: 83 KB
- Stars: 30
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Solution10\Calendar
The Calendar component is a simple, but powerful package to help you in the rendering of, well, Calendars!
[](https://travis-ci.org/Solution10/calendar)
[](https://packagist.org/packages/solution10/calendar)
[](https://packagist.org/packages/solution10/calendar)
[](https://packagist.org/packages/solution10/calendar)
## Features
- No dependancies
- PHP 5.3+
- Straightforward interface
- Support for multiple "resolutions" (week view, month view etc)
- Easily extended
- Templating system agnostic
## Getting Started
Installation is via composer, in the usual manner:
```json
{
"require": {
"solution10/calendar": "^1.0"
}
}
```
Creating a basic calendar is as such:
```php
setResolution(new MonthResolution());
// That's it! Let's grab the view data and render:
$viewData = $calendar->viewData();
$months = $viewData['contents'];
?>
title('F Y'); ?>
weeks()[0]->days() as $day): ?>
date()->format('D'); ?>
weeks() as $week): ?>
days() as $day): ?>
isOverflow()) {
if ($calendar->resolution()->showOverflowDays()) {
echo ''.$day->date()->format('d').'';
} else {
echo ' ';
}
} else {
echo $day->date()->format('d');
}
?>
```
Solution10\Calendar does not provide you with templates as we have no idea what templating
engine (if any) you're using. Instead, we give you a powerful and simple API so you can
do the rendering yourself.
## Further Reading
### Userguide
For more information on creating Calendars, see the [Calendars Section](http://github.com/solution10/calendar/wiki/Calendars).
If you want to know more about Resolutions, check out the [Resolutions Section](http://github.com/solution10/calendar/wiki/Resolutions).
Want to see how you can add Events to your calendars? You'll be wanting the [Events Section](http://github.com/solution10/calendar/wiki/Events).
## PHP Requirements
- PHP >= 5.3
## Author
Alex Gisby: [GitHub](http://github.com/alexgisby), [Twitter](http://twitter.com/alexgisby)
## License
[MIT](http://github.com/solution10/calendar/tree/master/LICENSE.md)
## Contributing
[Contributors Notes](http://github.com/solution10/calendar/tree/master/CONTRIBUTING.md)