Created
October 16, 2012 03:44
-
-
Save khepin/3897130 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Acme\WhateverBundle\FormType; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\FormBuilderInterface; | |
use Symfony\Component\OptionsResolver\OptionsResolverInterface; | |
use Acme\WhateverBundle\FormSubscriber\UserListener; | |
class FriendMessageFormType extends AbstractType | |
{ | |
private $subscriber; | |
public function __construct(UserListener $subscriber) | |
{ | |
$this->subscriber = $subscriber; | |
} | |
public function buildForm(FormBuilderInterface $builder, array $options) | |
{ | |
$builder | |
->add('subject', 'text') | |
->add('body', 'textarea') | |
; | |
$builder->addEventSubscriber($this->subscriber); | |
} | |
public function getName() | |
{ | |
return 'acme_friend_message'; | |
} | |
public function setDefaultOptions(OptionsResolverInterface $resolver) | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment