frequence-web / calendr-bundle
This bundle provides an integration of the CalendR library
Installs: 78 789
Dependents: 0
Suggesters: 0
Security: 0
Stars: 24
Watchers: 4
Forks: 9
Open Issues: 5
Type:symfony-bundle
Requires
- php: ^5.6|^7.0
- symfony/framework-bundle: ^2.8|^3.0|^4.0
- yohang/calendr: ^1.1|^2.0
Requires (Dev)
- phpunit/phpunit: ^5.7|^6.0|^7.0
This package is not auto-updated.
Last update: 2022-02-01 12:20:40 UTC
README
This bundle provides CalendR integration.
It allows you to manage calendar and events.
Calendar generation
Controller:
/** * @Template() */ public function indexAction() { return array('month' => $this->get('calendr')->getMonth(2012, 01)); }
Template
<table> {% for week in month %} <tr> {% for day in week %} <td> {% if month.contains(day) %} {{ day.begin.format('d') }} {% else %} {% endif %} </td> {% endfor %} </tr> {% endfor %} </table>
Event management
Providers
To manage your events, you have to create a provider and an event class. See CalendR doc
Declare your provider
This bundle allows you to easily add your providers to the CalendR event manager. Your provider have to be a service.
#config.yml services: my_event_provider: class: Your\Bundle\Event\Provider tags: - { name: calendr.event_provider }