46 lines
950 B
PHP
46 lines
950 B
PHP
<?php
|
|
namespace common\modules\event\widgets\event;
|
|
use common\models\Event;
|
|
use common\modules\event\models\timetable\TimeTableMonthDay;
|
|
use yii\base\Widget;
|
|
|
|
|
|
/** @noinspection PhpUnused */
|
|
|
|
/**
|
|
* Class TimeTableMonthDayView
|
|
* @package common\modules\event\widgets
|
|
*
|
|
* @property Event $event
|
|
*/
|
|
class EventView extends \yii\bootstrap\Widget
|
|
{
|
|
public $event;
|
|
public $start;
|
|
public $end;
|
|
|
|
public function init(){
|
|
parent::init();
|
|
if ( isset($this->event )){
|
|
$this->start = new \DateTime();
|
|
$this->start->setTimestamp($this->event->start);
|
|
$this->end = new \DateTime();
|
|
$this->end->setTimestamp($this->event->end);
|
|
}
|
|
}
|
|
|
|
|
|
public function run(){
|
|
return $this->render('_event',
|
|
[
|
|
'event' => $this->event,
|
|
'start' => $this->start,
|
|
'end' => $this->end
|
|
]
|
|
);
|
|
}
|
|
|
|
|
|
|
|
}
|