定制 arkhas/laravel5calendar 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

统计信息

  • 总下载量: 1.62k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 18
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 16
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-05-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固