Skip to content

Instantly share code, notes, and snippets.

View Ziiweb's full-sized avatar

Javier Garcia Ziiweb

View GitHub Profile
@Ziiweb
Ziiweb / dabblet.css
Created June 12, 2013 13:54 — forked from oksushi/dabblet.css
Using display: table-cell to evenly determine widths. You can add an arbitrary number of <li>
/**
* Using display: table-cell to evenly determine widths. You can add an arbitrary number of <li>
*/
ul {
padding: 0;
display: table;
width: 100%;
background: hotpink;
@Ziiweb
Ziiweb / dabblet.css
Created June 12, 2013 13:54
Using display: table-cell to evenly determine widths. You can add an arbitrary number of <li>
/**
* Using display: table-cell to evenly determine widths. You can add an arbitrary number of <li>
*/
ul {
padding: 0;
display: table;
width: 100%;
background: hotpink;
//Project/Bundle/AdminBundle/Resources/config/services.yml
services:
project.temporada.admin.temporada:
class: Project\Bundle\AdminBundle\Temporada
calls:
- [ setTranslationDomain, messages]
//Project/Bundle/AdminBundle/Resources/translations/messages.es.xlf
<?xml version="1.0"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
$form = $this->createFormBuilder()
//$form = $this->get('form.factory')->createNamedBuilder('mes')
->setAction($this->generateUrl('project_frontend_galeria'))
->setMethod('GET')
->add('mes', 'choice', array('choices' => $mesesGaleriaNombre))
->add('submit', 'submit', array('label' => 'Mostrar'))
->getForm();
$form->handleRequest($request);
public function handleRequest($request = null)
{
$this->config->getRequestHandler()->handleRequest($this, $request);
return $this;
}
$em = $this->getDoctrine()->getManager();
$query = $em->createQuery(
'SELECT c
FROM PlacasFrontendBundle:Columna c
JOIN c.products p
ORDER BY c.posicion ASC, p.posicion ASC'
);
$columnas = $query->getResult();
abstract class AbstractType implements FormTypeInterface
{
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
}
/**
namespace Placas\FrontendBundle\Admin;
use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Route\RouteCollection;
//use Placas\FrontendBundle\Form\Type\ChoiceOrTextType;
class CategoriaAdmin extends Admin
<?php
use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Placas\FrontendBundle\DataTransformer\ValueToChoiceOrTextTransformer;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
class ChoiceOrTextType extends AbstractType
{
->add('menu', new ChoiceOrTextType(), array(
'choices' => array('Option 1' => 'Option 1', 'Option 2' => 'Option 2'),
'required' => false,))
;