snippet controller
	<?php

	/*
	 * For the full copyright and license information, please view the LICENSE
	 * file that was distributed with this source code.
	 */

	use Symfony\Component\HttpFoundation\Response;
	use Symfony\Component\Security\Core\SecurityContext;
	use Symfony\Component\HttpFoundation\RedirectResponse;
	use Symfony\Bundle\FrameworkBundle\Controller\Controller;
	use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
	use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
	use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

	/**
	 * ${1:Name} controller
	 *
	 */
	class ${1}Controller extends Controller
	{
		/**
		 * ${2:Action} action
		 *
		 * @Route("/${3}", name="${4}")
		 * @Template()
		 */
		public function ${2}Action()
		{
			${3}
		}

	}

snippet action

	/**
	 * ${1:name} action
	 *
	 * @Route("/$1", name="${2}")
	 * @Template()
	 */
	public function $1Action()
	{
		${3}
	}

snippet getAction

	/**
	 * Get one ${1:Document}
	 */
	public function get$1($${2:slug})
	{
		$${3:document} = $this->get('doctrine.odm.mongodb.document_manager')
			->getRepository('${4:ApplicationCoreBundle}:$1')
			->findOneBy(array('{2}' => $2));

		if (!$$3) {
			throw $this->createNotFoundException('No $3 found');
		}

		return $$3;
	}

snippet newAction

	/**
	 * Create one ${1:Document}
	 *
	 * @Route("/new/{${2:id}}", name="${3:application_core_document_new}")
	 * @Template()
	 *
	 */
	public function newAction()
	{
		$${4} = new $1();
		$form = $this->createForm(new $1FormType(), $$4);

		if ($this->processForm($form, $$4)) {
	        $this->get('session')->getFlashBag()->set('success', '$1 updated.');

			return $this->redirect($this->generateUrl('${5:application_core_document_show}', array('${6:id}' => $$4->get${7:Id}())));
		}
	}

snippet editAction

	/**
	 * Edit one ${1:Document}
	 *
	 * @Route("/edit/{${2:id}}", name="${3:application_core_document_edit}")
	 * @Template()
	 *
	 */
	public function editAction($$2)
	{
		$${4} = $this->get$1($$2);

		$form = $this->createForm(new $1FormType(), $$4);
	}

snippet processForm
	/**
	 * Process ${1:Document} Form
	 */
	public function processForm($form, $${2:document})
	{
		$request = $this->get('request');

		if ($request->getMethod() == 'POST') {

			$form->bind($request);

			if (true === $form->isValid()) {
				$dm = $this->get('doctrine.odm.mongodb.document_manager');

				$dm->persist($$2);
				$dm->flush();

				return true;
			}
		}

		return false;
	}

snippet $form  
	$form = $this->createForm(new ${1:Document}FormType(), $${2:document});

snippet forward
	return $this->forward('${1:ApplicationCoreBundle}:${2:Controller}:${3:Action}');

snippet redirect
	return $this->redirect($this->get('router')->generate('${1:route}', 301);

snippet flash
	$this->get('session')->getFlashBag()->set('success', '$1 updated.');

snippet return
	return array(
		'${1:var}' => $$1,
	);

snippet print_r
	print_r(${1}); exit;

snippet ld 
	ld($${1:var}); exit;	

snippet use
	use ${1:Foo\Bar\Baz};
	${2}

snippet	class
	${1:protected} class ${2:name}()
	{
		${3}
	}

snippet this
	$this->${1} = ${2};

snippet function
	function ${1:foo}(${2:array }${3:$bar})
	{
		${4}
	}

snippet service
	${1} = $this->get('${2}');

snippet gs
	public function get${1:Foo}()
	{
		return $this->${2:foo};
	}

	public function set$1($$2)
	{
		$this->$2 = $$2;
		return $this;
	}

snippet set 
	public function set${1:Foo}($${2:foo})
	{
		$this->${2} = $${2};

		return $this;
	}

snippet get
	public function get${1:Foo}()
	{
		return $this->${2:foo};
	}

snippet =?:
	$${1:foo} = ${2:true} ? ${3:a} : ${4};

snippet ?:
	${1:true} ? ${2:a} : ${3}

snippet request 
	$request = $this->get('request');

snippet reqget
	$${1:var} = $request->query->get('${1}');

snippet reqpost
	$${1:var} = $request->request->get('${1}');

snippet session
	$session = $this->get('session');

snippet sessionVar
	$${1:var} = $session->get('${1}');
	
snippet /**
	/**
	 * ${1}
	 */

snippet namespace
	namespace `substitute(substitute(substitute(expand("%:p"), '\v(.*\/\l+)((\/\u\w+)+)\/\u\w+.php$', '\2', ''), '\/', '\\\', 'g'), '^\\\', '', '')`;

snippet gotime
	<?php
	/*
	 * For the full copyright and license information, please view the LICENSE
	 * file that was distributed with this source code.
	 */

	namespace ${1:`substitute(substitute(substitute(expand("%:p"), '\v(.*\/\l+)((\/\u\w+)+)\/\u\w+.php$', '\2', ''), '\/', '\\\', 'g'), '^\\\', '', '')`};

	/**
	 * ${1}
	 *
	 * @author Joris de Wit <joris.w.dewit@gmail.com>
	 */
	class ${2:ClassName}
	{
		${3}

		/**
		 * ${4}
		 */
		${5:public} function ${6:__construct}(${7:arguments})
		{
			${8:// code...}
		}
	}

snippet while
	while (${1:/* condition */}) {
		${2:// code...}
	}

snippet dowhile
	do {
		${2:// code... }
	} while (${1:/* condition */});

snippet if
	if (${1:/* condition */}) {
		${2:// code...}
	}
	${3}

snippet ifelse
	if (${1:/* condition */}) {
		${2:// code...}
	} else {
		${3:// code...}
	}
	${4}

snippet else
	else {
		${1:// code...}
	}

snippet elseif
	elseif (${1:/* condition */}) {
		${2:// code...}
	}

snippet switch
	switch ($${1:variable}) {
		case '${2:value}':
			${3:// code...}
			break;
		${5}
		default:
			${4:// code...}
			break;
	}

snippet case
	case '${1:value}':
		${2:// code...}
		break;
	${3}

snippet foreach
	foreach ($${1:variable} as $${2:value}) {
		${3:// code...}
	}

snippet foreachkeyval
	foreach ($${1:variable} as $key => $val) {
		${2:// code...}
	}
	${3}

snippet array
	array('${1}' => ${2})

snippet try
	try {
		${2}
	} catch (${1:\Exception} $e) {
		${3}
	}

snippet rett
	return true;

snippet retf
	return false;
