andrewdanilov / yii2-site-years
Site years
Package info
github.com/AndrewDanilov/yii2-site-years
Type:yii2-extension
pkg:composer/andrewdanilov/yii2-site-years
1.0.0
2019-04-17 21:32 UTC
Requires
- php: >=5.6.0
- yiisoft/yii2: ~2.0.0
This package is auto-updated.
Last update: 2026-02-17 02:03:29 UTC
README
Widget displaying years of site existence
Installation
The preferred way to install this extension is through composer.
Either run
composer require andrewdanilov/yii2-site-years "~1.0.0"
or add
"andrewdanilov/yii2-site-years": "~1.0.0"
to the require section of your composer.json file.
Usage
Call widget
<?php echo \andrewdanilov\SiteYears\SiteYears::widget([ 'startYear' => 2018, // optional, default is current year 'delimiter' => ' - ', // optional, default is '-' ]);
Result
2018 - 2019
If current year is equal to start year:
<?php echo \andrewdanilov\SiteYears\SiteYears::widget([ 'startYear' => 2019, ]);
Result would be just:
2019