dev-master
9999999-devProvides a google calendar integration for your Symfony 3 Project.
MIT
The Requires
- php >=5.6.0
- symfony/framework-bundle 3.*
- google/apiclient ^2.0
The Development Requires
by Pierrick AUBIN
google calendar
Provides a google calendar integration for your Symfony 3 Project.
This bundle use Google API for list, create, or update events in Google Calendar., (*1)
Please feel free to contribute, to fork, to send merge request and to create ticket., (*2)
Go to the developers console : https://console.developers.google.com, (*3)
Create an oauth ID. Do not forget the redirect Uri., (*4)
Click on "Download JSON" to get your client_secret.json, (*5)
Run, (*6)
composer require fungio/google-calendar-bundle:dev-master
``` php <?php // app/AppKernel.php, (*7)
public function registerBundles() { $bundles = [ // ... new Fungio\GoogleCalendarBundle\FungioGoogleCalendarBundle() ]; }, (*8)
### Step 3: Configuration Copy your client_secret.json file for example in app/Resources/GoogleCalendarBundle/client_secret.json ```yml # app/config/parameters.yml fungio_google_calendar: google_calendar: application_name: "Google Calendar" credentials_path: "%kernel.root_dir%/.credentials/calendar.json" client_secret_path: "%kernel.root_dir%/Resources/GoogleCalendarBundle/client_secret.json"
``` php <?php // in a controller $request = $this->get('request_stack')->getMasterRequest();, (*9)
$googleCalendar = $this->get('fungio.google_calendar'); $googleCalendar->setRedirectUri($redirectUri);, (*10)
if ($request->query->has('code') && $request->get('code')) { $client = $googleCalendar->getClient($request->get('code')); } else { $client = $googleCalendar->getClient(); }, (*11)
if (is_string($client)) { return new RedirectResponse($client); }, (*12)
$events = $googleCalendar->getEventsForDate('primary', new \DateTime('now'); ```, (*13)
Provides a google calendar integration for your Symfony 3 Project.
MIT
google calendar