0
我使用FullCalendar,它的工作完美,但我需要添加href按鈕className ='btn'當我點擊重定向到查看頁面。Yii2 FullCalendar:如何添加鏈接按鈕
我的控制器代碼:
public function actionIndex()
{
$events = event::find()->all();
$taskes=[];
foreach ($events as $eve)
{
$event1 = new \yii2fullcalendar\models\Event();
$patient = patient::findOne($eve->patient_id);
$event1->className='btn'; // this button that i need to add link to : ['site/view', 'id' => $id ]
$event1->id = $eve->id;
$event1->title = $patient->patient_name;
$event1->start = $eve->event_date;
$taskes[] = $event1;
}
return $this->render('index', [
'events'=>$taskes,
]);
}
非常感謝你。 。我嘗試過了,它可以按我的意願工作,非常感謝你的幫助...... :) –