Tagged Questions
0
votes
2answers
34 views
Symfony2 dependency injection container sub-container
Is it possible to put some services in to another container which will be narrowed to a specific set o services? Or to separate some specific services to some kind of sub-container? I am asking this ...
0
votes
2answers
64 views
Symfony: tagging a command with console.command doesn't seem to work
By default Symfony tries to scan every bundle directory for a folder called 'Command' and searches for Console\Command classes in there.
But when you want to use the DIC and DI in you console ...
0
votes
1answer
36 views
How to debug tags and services configured in the symfony2 service container?
I am writing a service to handle AccessDeniedException and I found a way to solve it from Using Symfony2's AccessDeniedHandlerInterface
firewalls:
secured_area:
.....
...
0
votes
1answer
20 views
Symfony: findTaggedServiceIds() returns empty array
I my symfony 2.1 project I want to use findTaggedServiceIds() inside a custom service.
The service:
class GetServiceMaps
{
private $container;
public function __construct($container)
...
0
votes
1answer
53 views
Symfony2 Dependency Injection / Service Container
I'm pretty new to Symfony2 and have built a custom CMS which has various sections such as user management, page management, image library etc. I want to log all activity within the CMS, therefore ...
1
vote
1answer
30 views
symfony2 configure service with data from another service
Is it possible in Symfony2 to configure a service by injecting data from another service? For example, by calling a getter on another service?
In my specific case I am creating a (reusable) service ...
1
vote
1answer
67 views
Proper way to test a Symfony2 Service with Doctrine
I'm struggling to find the correct way to unit test my symfony 2 services which use doctrine or other common services.
What i have done so far:
In my understanding the controller actions should:
...
0
votes
1answer
55 views
Dependency Injection Symfony object creation parameters
I have been looking up how symfony does it's dependency injection. But I don't understand the direct purpose of it.
It seem to refer everything as a service. A service is something along the line of ...
0
votes
0answers
29 views
Adding a tag to an existing service in symfony2
I'm trying to make the doctrine object constructor, which is shipped with the jmsserializerbundle, work with my custom compilerpass by adding a tag to it. The purpose is to only enable it in some ...
9
votes
2answers
181 views
Making configuration node support both string and array in Symfony 2 configuration?
Can my configuration node source support both string and array values?
Sourcing from string:
# Valid configuration 1
my_bundle:
source: %kernel.root_dir%/../Resources/config/source.json
...
2
votes
1answer
96 views
JMS DI Extra Bundle: How do I inject a dependency only if it exists
I am using JMS DI to inject services with annotation:
use JMS\DiExtraBundle\Annotation as DI;
/**
* @DI\Service("foo.bar.service")
*/
class myClass
{
/**
* @DI\Inject("debug.stopwatch")
...
0
votes
1answer
48 views
Why do I receive the wrong object when asking for a service
I am defining a new authentication provider and I needed access to the password encoder factory, so I defined my provider as a service and asked for the encoder to be injected. Here is my service ...
1
vote
3answers
63 views
How to get subdomain in UserProvider
Im doing multitenant service where im validate users against:
username, password, subdomain
Me using FOSUserBundle
I would like to use UserProvider to be aware of from wchich domain its called and ...
1
vote
0answers
37 views
How to define delivery_address for additional mailer server in dev environment?
I'm using two swiftmailer services, one as a spool and one for instant mails, as described here How to define an additional mailer service to use the spool and send instant emails in Symfony2
But ...
1
vote
3answers
195 views
How to get Doctrine to work inside a helper function on Symfony2
I need to get doctrine working inside my helper, im trying to use like i normaly do in a controller:
$giftRepository = $this->getDoctrine( )->getRepository( 'DonePunctisBundle:Gift' );
But ...