This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($request->getMethod() == 'POST'){ | |
$form->bindRequest($request); | |
if ($form->isValid()){ | |
.... | |
return $this->redirect($this->generateUrl('my_route')); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
see https://gist.github.com/1223886 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function onFlush(OnFlushEventArgs $args) | |
{ | |
$em = $args->getEntityManager(); | |
$uow = $em->getUnitOfWork(); | |
foreach ($uow->getScheduledEntityInsertions() as $entity) { | |
if ($entity instanceof ImageInterface) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
protected function attachImages($object) | |
{ | |
foreach ($object->getImages() as $image) { | |
$image->setArticolo($object); | |
} | |
} | |
public function prePersist($object) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class NewsAdmin extends BaseAdmin | |
{ | |
protected function configureFormFields(FormMapper $formMapper) | |
{ | |
$formMapper | |
->with('Text', array('collapsed' => false)) | |
->add('translations', 'collection', array('type' => new NewsI18nType())) | |
->end(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Symfony\Component\HttpFoundation\Response; | |
public function showAction($id) | |
{ | |
$repository = $this->getDoctrine()->getRepository('AcmeHelloBundle:Product'); | |
$product = $repository->find($id); | |
if (!$product) { | |
throw $this->createNotFoundException('Nessun prodotto trovato per num id: '.$id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function indexAction($search) | |
{ | |
if ( true === $search ) { | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_once __DIR__.'/../app/AppCache.php'; | |
$kernel = new AppCache($kernel); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Edimotive\SaloneBundle\Service; | |
use Symfony\Component\HttpKernel\Event\FilterResponseEvent; | |
use Symfony\Component\HttpKernel\Event\FilterControllerEvent; | |
use Edimotive\SaloneBundle\Service\ControllerExtendableInterface; | |
use Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
use Edimotive\SaloneBundle\Service\CustomControllerManager; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function getRepository($name) | |
{ | |
$em = $this->getEntityManager(); | |
$entity = $this->getExtendedEntity($name); | |
if (is_null($entity)) { | |
$entity = $this->getDefaultEntity($name); | |
} |
OlderNewer