如何在我的完整日历中提供超链接?

How can I give HyperLink in my full calender?

我正在日历中显示我的活动。它会正确显示它。但我希望当我点击该事件时它会重定向到特定的 event_detail 页面。

我是 laravel 的初学者,请问您能帮帮我吗???

这是我的控制器文件

<?php

namespace App\Http\Controllers\Admin;

use Carbon;
use Calendar;
use App\Event;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class CalendarController extends Controller
{

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('auth');
    }

    /*
    *Display All The Events In Calendar
    *
    */
    public function calendar()
    {
        $event = [];
        $allEvent = Event::all();

        if($allEvent->count())
        {
            foreach ($allEvent as $key => $eventList) 
            {
                $event[] = Calendar::event(
                    $eventList->name,
                    true,
                    new \DateTime($eventList->event_date),
                    new \DateTime($eventList->evet_date)
                );
            }
        }
        $showInCalendar = Calendar::addEvents($event);
        return view('admin.calendar.event_calendar', compact('showInCalendar', 'allEvent'));
    }
}

这是很多 blade 文件

@extends('admin.layout.default')

@section('css')
<link href="{{ url('assets/plugins/calendar/dist/fullcalendar.css') }}" rel="stylesheet" />
@endsection

@section('content')

<div class="row page-titles">
    <div class="col-md-5 col-8 align-self-center">
        <h3 class="text-themecolor">Calendar</h3>
        <ol class="breadcrumb">
            <li class="breadcrumb-item"><a href="{{ url('/home') }}">Dashboard</a></li>
            <li class="breadcrumb-item active">Calendar</li>
        </ol>
    </div>
</div>


<div class="row">
    <div class="col-lg-12">
        <div class="card card-outline-info">
            <div class="card-body">
                <div class="container">
                    <div class="row justify-content-center">
                        <div id="calendar">                            

                            {!! $showInCalendar->calendar() !!}

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection

@section('jsPostApp')
{!! $showInCalendar->script() !!}
<script src="{{ url('assets/plugins/calendar/jquery-ui.min.js') }}"></script>
<script src="{{ url('assets/plugins/moment/moment.js') }}"></script>
<script src="{{ url('assets/plugins/calendar/dist/fullcalendar.min.js') }}"></script>
<script type="text/javascript">
</script>
@endsection

我不知道如何处理该超链接以打开该特定事件的详细信息页面。

实现该行为非常容易。

您需要设置 属性 url in your event objects. Once you have it, you can use the callback eventClick 来重定向用户。默认情况下,eventClick 将始终重定向到 url 内的 link。

如果您想在不同的选项卡或弹出窗口中显示它,请查看事件中的取消默认行为部分单击link我在这里发布.

哇哦我找到了解决方案

public function calendar()
    {
        $event = [];
        $allEvent = Event::all();

        if($allEvent->count())
        {
            foreach ($allEvent as $key => $eventList) 
            {
                $event[] = Calendar::event(
                    $eventList->name,
                    true,
                    new \DateTime($eventList->event_date),
                    new \DateTime($eventList->event_date),
                    null,
                    [
                        'url' => 'event/' .$eventList->id,
                    ]

                );
            }
        }