Skip to content

Instantly share code, notes, and snippets.

@danbower
danbower / gist:3dd39392f8b9ab15c0c1
Created January 2, 2015 21:30
Manual login for symfony
public function manualLoginAction()
{
$user = $this->getDoctrine()->getRepository('UserBundle:User')->find(1);
$token = new UsernamePasswordToken($user, $user->getPassword(), 'admin_area', $user->getRoles());
$this->get('security.context')->setToken($token);
$request = $this->get('request');
$event = new InteractiveLoginEvent($request, $token);
$this->get("event_dispatcher")->dispatch('security.interactive_login', $event);
@danbower
danbower / index.html
Last active October 18, 2015 18:33
HTML5 Starter Template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Starter Template</title>
<link href="style.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>