Skip to content

Instantly share code, notes, and snippets.

View patashnik's full-sized avatar

Aleksei patashnik

  • Moscow, Russia
View GitHub Profile
@patashnik
patashnik / form.html
Created May 19, 2011 09:27
Forms "dynamic" validators
<form method="post">
<div>
<label>First <input type="radio" name="choice" value="1" /></label>
<input type="text" name="first_text" />
</div>
<div>
<label>Second <input type="radio" name="choice" value="2" /></label>
<input type="text" name="second_text" />
</div>
</form>
@patashnik
patashnik / Controller.php
Created April 8, 2011 09:55
Experimental Form
<?php
public function someAction()
{
$factory = $this->get('form.factory');
$form = $factory->create(new ExperimentalForm(), 'form');
$request = $this->get('request');
if ($request->getMethod() === 'POST') {
$form->bindRequest($request);