Skip to content

Instantly share code, notes, and snippets.

View johnkary's full-sized avatar

John Kary johnkary

View GitHub Profile
class ProjectConfiguration extends sfProjectConfiguration
{
public function setup()
{
$this->setupProjectPlugins();
}
/**
* Responsible for initiating any plugins and pointing vendor plugins
* to the "vendor" subdirectory
@pborreli
pborreli / Configuration.class.php
Created September 13, 2010 16:12
how to replace a specific widget by another for all generated forms in symfony
<?php
class xxxConfiguration extends sfXxxConfiguration
{
public function setup()
{
$this->dispatcher->connect('command.filter_options', array($this, 'filterCommandOptions'));
}
<?xml version="1.0"?>
<project name="" default="empty" basedir=".">
<description>W</description>
<property file="config.properties"/>
<target name="empty">
<echo>Please choose what to deploy: all, nginx, website</echo>
</target>
@weaverryan
weaverryan / 8a38a6f_style_4.css
Created July 30, 2011 18:09
Assetic relative path setup
/* /app_dev.php/css/8a38a6f_style_4.css */
/* The cssrewrite filter physically adds an extra ../ so that the this resolves correctly in dev */
body{
background: url(../../images/bodyBg.png) repeat-x;
font-family: Georgia, "Times New Roman", Times, serif;
}
@weaverryan
weaverryan / behat
Created September 4, 2011 21:03
Small script to easily execute behat inside Symfony2
#!/bin/sh
# A little shortcut script for executing Behat inside a Symfony2 project
#
# Configure behat in Symfony2 per the following instructions and then place this in the root of your project
# http://docs.behat.org/bundle/index.html
#
# Example Usage:
# ./behat @BlogBundle
@havvg
havvg / bdd-experiment-guide.md
Created September 9, 2011 14:44
Behavior Driven Development in Symfony2 with Behat, Mink and Zombie.js
@avalanche123
avalanche123 / Makefile
Created October 18, 2011 23:39
new PHP project Makefile
# Makefile for php project setup
#
# You can set these variables from the command line.
AUTHOR = Author
PROJECT = Project
BUILDFILE = project.phar
SRCDIR = src
TESTDIR = tests
PHPUNITCONFIG = phpunit.xml.dist
@havvg
havvg / Builder.php
Created February 8, 2012 15:51
Symfony2 KnpMenu TwitterBootstrap switch user menu
<?php
namespace Ormigo\Bundle\BackofficeBundle\Menu;
use Knp\Menu\FactoryInterface;
use Symfony\Component\DependencyInjection\ContainerAware;
use Ormigo\Bundle\UserBundle\Model\User\UserQuery;
use Symfony\Component\Security\Core\Role\SwitchUserRole;
@jmikola
jmikola / RouterRequestContextPass.php
Created March 6, 2012 07:47
A cure for "localhost" appearing in absolute URL's when rendering a template from the Symfony2 CLI
<?php
namespace Application\ExerciseBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
/**
* Overrides the default host for the Router's RequestContext service.
*
@Ocramius
Ocramius / User.php
Last active February 16, 2024 14:57
Doctrine 2 ManyToMany - the correct way
<?php
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @ORM\Entity()
* @ORM\Table(name="user")
*/
class User