File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -408,13 +408,15 @@ it with :ref:`dic-tags-form-type`.
408408 .. code-block :: php
409409
410410 // app/config/config.php
411- $definition = new Definition('AppBundle\Form\Type\FriendMessageFormType');
412- $definition->addTag('form.type', array('alias' => 'app_friend_message'));
413- $container->setDefinition(
414- 'app.form.friend_message',
415- $definition,
416- array('security.context')
411+ use Symfony\Component\DependencyInjection\Reference;
412+
413+ $definition = new Definition(
414+ 'AppBundle\Form\Type\FriendMessageFormType',
415+ array(new Reference('security.context'))
417416 );
417+ $definition->addTag('form.type', array('alias' => 'app_friend_message'));
418+
419+ $container->setDefinition('app.form.friend_message', $definition);
418420
419421 If you wish to create it from within a service that has access to the form factory,
420422you then use::
You can’t perform that action at this time.
0 commit comments