-
Notifications
You must be signed in to change notification settings - Fork 0
/
play.php
39 lines (28 loc) · 987 Bytes
/
play.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\Debug;
$loader = require_once __DIR__.'/app/bootstrap.php.cache';
Debug::enable();
require_once __DIR__.'/app/AppKernel.php';
$kernel = new AppKernel('dev', true);
$kernel->loadClassCache();
$request = Request::createFromGlobals();
$kernel->boot();
$container = $kernel->getContainer();
$container->enterScope('request');
$container->set('request', $request);
//all the setup is done!!! Woo hoo!
$templating = $container->get('templating');
echo $templating->render(
'EventBundle:Default:index.html.twig',
array('name' => 'Vader', 'count' => 3)
);
use Yoda\EventBundle\Entity\Event;
$event=new Event();
$event->setName("Darth's surprise birthday party!");
$event->setLocation('Deathstar');
$event->setTime(new \DateTime('tomorrow noon'));
//$event->setDetails('Ha! Darth HATES surprises!!!!!!!!');
$em = $container->get('doctrine')->getManager();
$em->persist($event);
$em->flush();