Widget that implements the fullcalendar plugin for Yii2
The preferred way to install this extension is through composer.
Either run
composer require --prefer-dist "tecnocen/yii2-fullcalendar:*"
or add
"tecnocen/yii2-fullcalendar": "*"
to the require
section of your composer.json
file.
This is the basic widget which encapsulates the plugin into a yii\base\Widget
implementation.
use tecnocen\fullcalendar\widgets\Fullcalendar;
echo Fullcalendar::widget([
// 'lang' => 'es',
'options' => [
// HTML attributes for the container.
// the `tag` option is specially handled as the HTML tag name
],
'clientOptions' => [
// JS Options to be passed to the `calendar()` plugin.
// see http://fullcalendar.com/#Documentation/Options
],
'clientEvents' => [
// JS Events for the `calendar()` plugin.
// see http://fullcalendar.com/#Documentation/Events
]
]);
The fullcalendar plugin provides the [following languages]
(https://github.com/fullcalendar/fullcalendar/tree/master/lang),
Fullcalendar
and ActiveCalendar
support automatic translations using the
$lang
class property which automatically will load the required js file
and customize the plugin call.
echo Fullcalendar::widget([
'options' => ['id' => 'es-calendar'],
'lang' => 'es',
]);
Will add the JS File es.js
to the view and run
jQuery('#es-calendar').calendar({"lang":"es"});
On the browser.
TODO
The BSD License (BSD). Please see License File for more information.