Skip to content

Instantly share code, notes, and snippets.

View Nek-'s full-sized avatar
:octocat:

Maxime Veber Nek-

:octocat:
View GitHub Profile
@Nek-
Nek- / SymfonyFormTransformer.php
Last active March 6, 2018 16:11 — forked from ostrolucky/SymfonyFormTransformer.php
Convert Symfony Form to text values
<?php
/**
* @param FormInterface $form
* @return string
*/
private function transformFormToText(FormInterface $form)
{
$txt = '';
foreach ($form->getData() as $inputName => $inputValue) {
$formElement = $form->get($inputName);
<?php
namespace ServicePlus\CoreBundle\Service;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityNotFoundException;
use ServicePlus\CoreBundle\Entity\Company;
use ServicePlus\CoreBundle\Entity\Device;
use ServicePlus\CoreBundle\Entity\Report;
use Symfony\Component\EventDispatcher\EventDispatcher;
<?php
namespace Ceva\CoreBundle\Listener;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Cookie;
@Nek-
Nek- / gist:7625843
Last active December 29, 2015 05:59 — forked from anonymous/gist:7625794
<?php
public function createAction(Request $request, $package_id)
{
$package = $this->getPackage($package_id);
$entity = new Prestation();
$entity->setPackage($package);
$form = $this->createCreateForm($entity);
$form->handleRequest($request);