Skip to content

Instantly share code, notes, and snippets.

@xabbuh
xabbuh / config1.xml
Last active December 28, 2015 19:19
The first example (config1.xml) works, the second (config2.xml) doesn't.
<!-- app/config/config_prod.xml -->
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:monolog="http://symfony.com/schema/dic/monolog"
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/monolog
http://symfony.com/schema/dic/monolog/monolog-1.0.xsd"
>
<monolog:config>
<monolog:config>
<monolog:handlers>
<monolog:handler name="main" type="stream" path="/var/log/symfony.log">
<monolog:channels>
<channel>!doctrine</channel>
</monolog:channels>
</monolog:handler>
<monolog:handler name="doctrine" type="stream" path="/var/log/doctrine.log" />
<monolog:channels>
<?php
// get the old stored value from the session
$modeloMarcaProductoArr = $session->get('modeloMarcaProductoId');
// add a new entry to the array
$modeloMarcaProductoArr[$marca->getId().'-'.$modelo->getId()] = $modeloMarcaProducto->getId();
// write this array back into the session
$session->set('modeloMarcaProductoId', $modeloMarcaProductoArr);
@xabbuh
xabbuh / gist:24ac7a03adfe1f2bd93b
Created December 11, 2014 13:26
.//label[contains(., 'foo')] selects the first and the third label element
<html>
<head>
<title>Test</title>
</head>
<body>
<p>Hello World</p>
<form method="post">
<label for="foo">foo</label> <input type="text" id="foo">
<label for="bar">bar</label> <input type="text" id="bar">
<?php
class Status
{
const YES = 'yes';
const NO = 'no';
const MAYBE = 'maybe';
private static $instances = array();
services:
topnode.manager.lot:
class: AuctionBundle\Manager\LotManager
arguments:
- @doctrine.orm.entity_manager
- AuctionBundle\Entity\Lot
- @event_dispatcher
- @validator
composer/semver 1.2.0
doctrine/annotations v1.2.7
doctrine/cache v1.5.2
doctrine/collections v1.3.0
doctrine/common v2.6.0
doctrine/data-fixtures v1.1.1
doctrine/dbal dev-master 2241ee4
doctrine/doctrine-bundle 1.6.1
doctrine/doctrine-cache-bundle 1.2.2
doctrine/inflector v1.1.0
<?php
require __DIR__.'/vendor/autoload.php';
use Symfony\Component\DomCrawler\Crawler;
$html = <<<EOT
<html>
<head></head>
<body>
public function findByProductId($id) {
return $this->createQueryBuilder('mc')
->join('mc.product', 'product')
->where('product.id = :id')
->setParameter('id', $id)
;
}
json.form.normalizer:
class: Adsc\MyBundle\Normalizer\FormErrorNormalizer
tags:
- { name: serializer.normalizer, priority: 10 }