Skip to content

Instantly share code, notes, and snippets.

View johnwards's full-sized avatar

johnwards johnwards

  • Oxfordshire/Birmingham/London
View GitHub Profile
Uploading files (FileBase->UploadFile): 20/04/2010 09:47:15
$_FILES:
Array
(
[inpXML] => Array
(
[name] => Array
(
[Workshop] => Array
Uploading files (FileBase->UploadFile): 20/04/2010 09:55:29
$_FILES:
Array
(
[inpXML] => Array
(
[name] => Array
(
[Workshop] => Array
@johnwards
johnwards / XsltEngine.php
Created January 18, 2011 11:30
Sample calling route from xsl
<?php
class XsltEngine implements EngineInterface
{
//Snip..
protected static $router_instance;
public static function route_generate($name, $json)
{
$params = json_decode($json,true);
<?php
namespace WhiteOctober\FormBuilderBundle\Form;
use WhiteOctober\FormBuilderBundle\Document\FormBuilder;
use Symfony\Component\Form\Form;
use Symfony\Component\Form\TextField;
use Symfony\Component\Form\IntegerField;
<?php
namespace WhiteOctober\FormBuilderBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use WhiteOctober\FormBuilderBundle\Document\FormBuilder;
use WhiteOctober\FormBuilderBundle\Document\Element;
use WhiteOctober\FormBuilderBundle\Form\FormBuilderForm;
use Symfony\Component\Form\Form;
Feature: New Study
In order to create a new Study
As a Researcher
I must be able to enter information about the study and save it
Scenario Outline: Researcher adds new study
When I enter a study name of <study name>
And I enter a short url of <short url>
And I enter a some welcome text of <welcome text>
And I set self registration to <self registration>
<?php
/**
* @mongodb:Document(db="woformbuilder",collection="forms")
*/
class FormBuilder
{
/** @mongodb:Id */
private $id;
@johnwards
johnwards / gist:843530
Created February 25, 2011 08:36
FormBuilderForm.php
<?php
namespace WhiteOctober\FormBuilderBundle\Form;
use Symfony\Component\Form\Form;
use Symfony\Component\Form\TextareaField;
class FormBuilderForm extends Form
{
public function configure()
<?php
namespace Symfony\Tests\Component\Form\Renderer\Plugin;
use Symfony\Component\Form\Renderer\Plugin\ValuePlugin;
use Symfony\Component\Form\Renderer\DefaultRenderer;
use Symfony\Component\Form\FieldInterface;
class ValuePluginTest extends \PHPUnit_Framework_TestCase
@johnwards
johnwards / gist:849084
Created March 1, 2011 13:03
FieldPluginTest.php
<?php
namespace Symfony\Tests\Component\Form\Renderer\Plugin;
use Symfony\Component\Form\Renderer\Plugin\FieldPlugin;
use Symfony\Component\Form\Renderer\DefaultRenderer;
use Symfony\Component\Form\FieldInterface;
class FieldPluginTest extends \PHPUnit_Framework_TestCase