Php Yii2 FullCalendar:如何添加链接按钮
我正在使用,它工作得很好,但当我单击重定向以查看页面时,我需要将href添加到按钮className='btn' 控制器中的我的代码:Php Yii2 FullCalendar:如何添加链接按钮,php,html,yii2,fullcalendar,yii2-advanced-app,Php,Html,Yii2,Fullcalendar,Yii2 Advanced App,我正在使用,它工作得很好,但当我单击重定向以查看页面时,我需要将href添加到按钮className='btn' 控制器中的我的代码: public function actionIndex() { $events = event::find()->all(); $taskes=[]; foreach ($events as $eve) { $event1 = new \yii2fullcalendar\models\Event(); $p
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,
]);
}
我想你可以这样做:
...
$event1->url = Url::to(['site/view', 'id' => $id ]);
...
查看文档-非常感谢。。我试过了,它可以正常工作,非常感谢你的帮助……:)