Skip to content

Instantly share code, notes, and snippets.

View florinutz's full-sized avatar
🌴
I'd much rather have Foucalt quoted at computer conferences than Dijkstra

Florin florinutz

🌴
I'd much rather have Foucalt quoted at computer conferences than Dijkstra
  • Berlin
View GitHub Profile
$pdfEngine = $this->container->get('knp_snappy.pdf');
$response
->setContent($pdfEngine->getOutputFromHtml($html, [
'header-left' => 'nothing',
'header-center' => 'nothing again',
'header-html' => $this->admin->generateUrl('pdf-header', [], true)
]))
->headers->add([
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'attachment; filename="wyzbiz_invoice_' . $invoice->getInvoiceNumber() . '.pdf"'
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.3",
{% if admin.hasroute('validate') %}
{{ admin.generateObjectUrl('validate', object) }}
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$resources = $container->hasParameter('twig.form.resources') ? $container->getParameter('twig.form.resources') : array();
$resources[] = 'WyzbizMainBundle:Form:fields.html.twig';
$resources[] = 'WyzbizMainBundle:Form:type_model_list_multiple.html.twig';
$container->setParameter('twig.form.resources', $resources);
{% use 'SonataAdminBundle:Form:form_admin_fields.html.twig' %}
{% block sonata_type_model_list_widget %}
test
{% endblock %}
<?php
// florin 3/25/14 2:16 PM
namespace Wyzbiz\Bundle\MainBundle\Form\Extension;
use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\FormView;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\PropertyAccess\PropertyAccess;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
<?php
// florin 3/13/14 12:12 PM
namespace Wyzbiz\Bundle\MainBundle\Form\Type;
use Sonata\AdminBundle\Form\DataTransformer\ModelsToArrayTransformer;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\Form\FormBuilderInterface;
<?php
// florin 3/13/14 12:12 PM
namespace Wyzbiz\Bundle\MainBundle\Form\Type;
use Sonata\AdminBundle\Form\DataTransformer\ModelsToArrayTransformer;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\Form\FormBuilderInterface;
<?php
// florin 3/13/14 12:12 PM
namespace Wyzbiz\Bundle\MainBundle\Form\Type;
use Sonata\AdminBundle\Form\DataTransformer\ModelsToArrayTransformer;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\Form\FormBuilderInterface;
In InvoicingClients:
/**
* @var ArrayCollection
*
* @ORM\ManyToMany(targetEntity="Customer", mappedBy="invoicingClients")
* @ORM\JoinTable(
* name="invoicing_clients_customers",
* joinColumns={@ORM\JoinColumn(name="client_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="customer_id", referencedColumnName="id")}