Skip to content

Instantly share code, notes, and snippets.

@stof
stof / TwigRenderer.php
Last active September 16, 2020 07:46
Rendering twig blocks directly from outside a twig render call, for email purpose
<?php
namespace Incenteev\MailerBundle\Mailer;
class TwigRenderer implements RendererInterface
{
private $twig;
private $styleInliner;
/**
@jgornick
jgornick / criteria-to-query-builder.php
Created January 28, 2014 16:57
Doctrine: Criteria Array to Doctrine QueryBuilder
<?php
/**
* Recursively takes the specified criteria and adds too the expression.
*
* The criteria is defined in an array notation where each item in the list
* represents a comparison <fieldName, operator, value>. The operator maps to
* comparison methods located in ExpressionBuilder. The key in the array can
* be used to identify grouping of comparisons.
*