Instantly share code, notes, and snippets.

View gist:5301760
#!/bin/bash
BUNDLE_NAME="@AcmeDemoBundle"
CREATE_USERS=0
DROP_DATABASE=1
RUN_TESTS=0
RUN_VERBOSE_TESTS=0
View gist:5291568
<form action="{{ path('manage_settings') }}" method="post">
{{ form_widget(form) }}
{{ form_rest(form) }}
<input type="submit" value="Update settings"/>
</form>
View gist:5291554
namespace Acme\DemoBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\Request;
use Acme\DemoBundle\Form\Type\SettingsFormType;
View gist:5291506
<?php
namespace Acme\DemoBundle\Form\Type;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Validator\Constraints\Regex;
use Symfony\Component\Validator\Constraints\Type;
use Symfony\Component\Validator\Constraints\Collection;
use Symfony\Component\Validator\Constraints\Valid;
View gist:5291408
<?php
namespace Acme\DemoBundle\Helper;
use Symfony\Component\Yaml\Parser;
use Symfony\Component\Yaml\Dumper;
use Symfony\Component\Yaml\Exception\ParseException;
class SettingsManager {
/**
View gist:3941962
private function createRowMeta($defaults, $additionalMeta = array())
{
if(!empty($additionalMeta['header'])) {
$this->defaultTextflowOptlist = "font=".$this->defaultFont." fontsize=10 fillcolor={rgb 1.0 0.0 0.0 }";
$this->markdownTextflowOptlists = array(
MarkdownParser::MD_BOLD => "font=".$this->markdownFonts[MarkdownParser::MD_BOLD]." fontsize=10 fillcolor={rgb 1.0 1.0 1.0}",
MarkdownParser::MD_ITALIC => "font=".$this->markdownFonts[MarkdownParser::MD_ITALIC]." fontsize=10 fillcolor={rgb 1.0 1.0 1.0}",
MarkdownParser::MD_UNDERLINE => "font=".$this->markdownFonts[MarkdownParser::MD_UNDERLINE]." fontsize=10 underline fillcolor={rgb 1.0 1.0 1.0}",
);
} else {
View ChangeController.php
$searchCriteria = array();
if (!empty($localCopyId)) {
$searchCriteria['LCId'] =
'JOIN Change.page Page '.
'WITH Page.document = :LCId';
}
if (!empty($authorId)) {
$searchCriteria['AuthorId'] = 'JOIN Change.createdBy Author WITH Author.id = :AuthorId';
}
if (!empty($regionCode)) {