arkhas/laravel5calendar
Composer 安装命令:
composer require arkhas/laravel5calendar
包简介
A calendar with event managment package for laravel 5 using Carbon and Blade templating
README 文档
README
Install the package through Composer :
composer require arkhas/laravel5calendar
Now all you have to do is add the service provider of the package and alias the package. To do this open your app/config/app.php file.
Add a new line to the service providers array:
Arkhas\Calendar\CalendarServiceProvider::class,
Add a new line to the aliases array:
'Calendar' => Arkhas\Calendar\Facades\Calendar::class,
Then insert this in the top of your file :
use Calendar;
Or use it directly :
$calendar = \Calendar::generate();
Now you're ready to start using the calendar package in your application.
Usage
You can use the generate method to generate a calendar, it will return the template of the calendar.
// Generate a calendar for the current month and year $calendar = Calendar::generate(); // Generate a calendar for the specified year and month $calendar = Calendar::generate(2012, 5); // Add an array of events as the third parameter to add them to the calendar (YYYY/MM/DD), $events = array( '2016/5/3', '2016/5/5', '2016/5/11', '2016/5/16', '2016/5/28', ); $calendar = Calendar::generate(2016, 5, $events); // Add an array of data as the fourth parameter so you can use them in the view : $data = array( 'name' => 'Arkhas', 'url' => '/event/arkhas', 'foo' => 'bar' ); $calendar = Calendar::generate(2016, 5, $events, $data);
For using it in you view, simply use :
{!! $calendar !!}
Routing
By default, the routing format is /calendar/YYYY/MM , you can change the leading route using the url data parameter :
$data['url'] = '/foo/bar/';
Template
If you want to use a custom template, run :
php artisan vendor:publish
The template is located in resources/views/vendor/calendar/calendar.blade.php
The css file is located in public/assets/arkhas/calendar/calendar.css
Navigate through the calendar
Add this to your template
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script> <script src="/assets/arkhas/calendar/calendar.js"></script>
Navigate through the calendar with links using the calendarButton Class.
The ajax script will replace the calendar class by an updated calendar.
For more information about how it work, you can navigate to /arkhas/demo and see the template in ressources/views/vendor/calendar/demo.blade.php
arkhas/laravel5calendar 适用场景与选型建议
arkhas/laravel5calendar 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.62k 次下载、GitHub Stars 达 16, 最近一次更新时间为 2016 年 05 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 arkhas/laravel5calendar 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 arkhas/laravel5calendar 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1.62k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 18
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-05-13