[FLOW3-general] @scope session

Rens Admiraal renst3 at e-rank.nl
Tue Dec 29 09:28:19 CET 2009


Hi all,

Maybe my question is not clear because I didn't receive any response yet. I'm 
sorry for asking your attention again, but I'm really lost how to use the 
scope @session of a class, and can't find any examples of it.

How should I make an instance (or get my) of a class with the scope session? 
And should injecting a session class into an object even work? And do I have 
to register a session object in my objects.yaml? Or is it autowired?

I really look forward to an answer :-)

Greetz,
Rens

On Sunday 27 December 2009 15:30:47 renst3 at e-rank.nl wrote:
> Maybe good to mention:
> I also tried creating a new instance using new \F3\Package\Test
> instead of the injection..., this does not generate any errors, but
> values don't seem to be preserved...
> 
> Quoting renst3 at e-rank.nl:
> > I've a question about the @session scope. If I understood it right a
> > class with the scope session is contained during the whole usersession.
> > So, this seems the right scope for a 'usersession' object ;-)
> >
> > But, how should I use it?
> >
> > Whenever I use an object with the scope @session I get the error
> > #1247211113: The session objects registry has not been injected
> > correctly into the object manager.
> >
> > To make sure the class itself does not contain any errors I created a
> > test class:
> >
> > <?php
> > declare(ENCODING = 'utf-8');
> > namespace F3\Package;
> >
> > /**
> >  * @scope session
> >  */
> > class Test
> > {
> >
> > }
> > ?>
> >
> > And I try to inject the object into a controller using:
> >
> > /**
> >  * @var F3\Package\Test
> >  * @inject
> >  */
> > protected $test;
> >
> > What am I doing wrong?
> >
> > With kind regards,
> > Rens
> > _______________________________________________
> > FLOW3-general mailing list
> > FLOW3-general at lists.typo3.org
> > http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general
> 
> _______________________________________________
> FLOW3-general mailing list
> FLOW3-general at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general
> 


More information about the FLOW3-general mailing list