frequence-web / calendr-bundle
1.2.2
2018-03-25 21:27 UTC
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
此包提供CalendR集成。
它允许你管理日历和事件。
日历生成
控制器
/** * @Template() */ public function indexAction() { return array('month' => $this->get('calendr')->getMonth(2012, 01)); }
模板
<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>
事件管理
提供者
要管理你的事件,你必须创建一个提供者和一个事件类。请参阅CalendR文档
声明你的提供者
此包允许你轻松地将你的提供者添加到CalendR事件管理器中。你的提供者必须是一个服务。
#config.yml services: my_event_provider: class: Your\Bundle\Event\Provider tags: - { name: calendr.event_provider }