andrewdanilov/yii2-site-years

Site years

1.0.0 2019-04-17 21:32 UTC

This package is auto-updated.

Last update: 2024-04-16 22:01:32 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