1. Go to this page and download the library: Download dyvelop/icalcreator-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
dyvelop / icalcreator-bundle example snippets
// File: app/AppKernel.php
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new \Dyvelop\ICalCreatorBundle\DyvelopICalCreatorBundle(),
);
// ...
return $bundles;
}
// ...
}
namespace AppBundle/Controller;
use Dyvelop\ICalCreatorBundle\Response\CalendarResponse;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class DefaultController extends Controller
{
public function indexAction()
{
$calendar = $this->get('dyvelop_icalcreator.factory')->create();
// add events to calendar etc.
// ...
return new CalendarResponse($calendar);
}
}
use Dyvelop\ICalCreatorBundle\Mailer\CalendarAttachment;
// create a new mail message via Swiftmailer
$mailer = $this->get('mailer');
$message = $mailer->createMessage();
// create calendar
$calendar = $this->get('dyvelop_icalcreator.factory')->create();
// add events to calendar etc.
// ...
// add calender attachment
$attachment = new CalendarAttachment($calendar);
$message->attach($attachment);
// add other message configurations like subject or body
// ...
$mailer->send($message);