Skip to content

Instantly share code, notes, and snippets.

View trq's full-sized avatar

Tony R Quilkey trq

  • thorpesystems
  • Sydney, Australia
View GitHub Profile
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/", "SymfonyStandard": "app/" }
},
"require": {
"php": ">=5.3.3",
<?php
namespace CellCare\SiteBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
class CmsController extends Controller
{
public function dynamicAction()
<?php
namespace SiteBundle\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
class CmsController implements ContainerAwareInterface
<?php
namespace Foo\SiteBundle\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
class CmsController implements ContainerAwareInterface
<?php
$errors = array();
foreach (array('email', 'name', 'age', 'occupation') as $key) {
if (!isset($_GET[$key]) || empty($_GET[$key])) {
$errors[] = "You need to fill in $key";
}
}
@trq
trq / gist:4a9e9263cb6788e1641d
Last active August 29, 2015 14:02
Re-define the package inline in your composer.json
{
"repositories": {
"doctrine-fixtures-bundle": {
"name": "doctrine/doctrine-fixtures-bundle",
"type": "symfony-bundle",
"version": "2.0.0",
"require": {
"php": ">=5.3.2",
"symfony/symfony": ">=2.0"
},
{{ Form::text('username', 'null', array('placeholder' => 'hold') }}
<?php
public function registerEngineResolver()
{
$this->app->bindShared('view.engine.resolver', function($app)
{
$resolver = new EngineResolver;
// Next we will register the various engines with the resolver so that the
// environment can resolve the engines it needs for various views based
<?php
$formatter = new NumberFormatter('en_AU', NumberFormatter::SPELLOUT);
$formatter->setTextAttribute(NumberFormatter::DEFAULT_RULESET, "%spellout-ordinal");
for ($i = 1; $i <= 5; $i++) {
echo $formatter->format($i) . "\n";
}
g:vdebug_options['path_maps'] = {"/var/www/cc": "/Users/trq/src/clients/cc/site"}
autocmd FileType html setlocal ts=2 sts=2 sw=2 expandtab
autocmd FileType htmljinja setlocal ts=2 sts=2 sw=2 expandtab
autocmd FileType css setlocal ts=2 sts=2 sw=2 expandtab
autocmd FileType javascript setlocal ts=2 sts=2 sw=2 expandtab
autocmd FileType php setlocal ts=4 sts=4 sw=4 expandtab