定制 busayo/laravel-yearly 二次开发

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

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

busayo/laravel-yearly

最新稳定版本:1.1.0

Composer 安装命令:

composer require busayo/laravel-yearly

包简介

Provides helper function to get the current year and a range of years

README 文档

README

Latest Stable Version License Build Status Quality Score Total Downloads

Laravel 5 Package to help keep your copyright year up-to-date. Simple but insanely useful.

Install

PHP 5.5+ or HHVM 3.3+, and Composer are required.

Via Composer

$ composer require busayo/laravel-yearly

Another alternative is to simply add the following line to the require block of your composer.json file.

"unicodeveloper/laravel-yearly": "1.1.*"

Then run composer install or composer update to download it and have the autoloader updated.

Add this to your providers array in config/app.php

// Laravel 5: config/app.php

'providers' => [
    ...
    'Unicodeveloper\Yearly\YearlyServiceProvider',
    ...
];

This package also comes with a facade

// Laravel 5: config/app.php

'aliases' => [
    ...
    'Yearly' => 'Unicodeveloper\Yearly\YearlyFacade',
    ...
]

Usage

Use it in your views, preferably in your footer section like this:

{{ current_year() }}  // returns 2015 ( This is the current year presently )

{{ year_range(2002) }} // returns 2002 - 2015

For those that love Facades immensely, I have provided the cake for you 😄 like so:

{{ Yearly::current_year() }}  // returns 2015 ( This is the current year presently )

{{ Yearly::year_range(2002) }} // returns 2002 - 2015

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

You can run the tests with:

vendor/bin/phpunit run

Alternatively, you can run the tests like so:

composer test

Inspiration

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

  • Stars: 10
  • Watchers: 1
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-09-15