[TYPO3-mvc] How to use FrontendUserGroup ?
Felix Eggbert
eggbert at phez.com
Fri Mar 18 19:38:18 CET 2011
Hi Armin,
I thought using DI for Models did not work yet
(http://forge.typo3.org/projects/typo3v4-mvc/wiki/Dependency_Injection_(DI))
? How do you get it to work like that in your example?
/**
* Injects the comment repository
*
* @param Tx_PwComments_Domain_Repository_CommentRepository $repository
* the repository to inject
*
* @return void
*/
public function injectCommentRepository(
Tx_PwComments_Domain_Repository_CommentRepository $repository
) {
$this->commentRepository = $repository;
}
Thanks and best regards,
Felix
-----Ursprüngliche Nachricht-----
Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org
[mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag von
Armin Rüdiger Vieweg
Gesendet: Freitag, 18. März 2011 17:25
An: typo3-project-typo3v4mvc at lists.typo3.org
Betreff: Re: [TYPO3-mvc] How to use FrontendUserGroup ?
> Creating and modifying my members does work fine but now I want to be
> able to choose the usergroup for this member.
At first, you should inject the
Tx_Extbase_Domain_Repository_FrontendUserGroupRepository and not make an
instance in initializeAction. You'll find an example of dependency injection
here: http://goo.gl/IuKNV (see injectFrontendUserRepository
method)
Then $this->frontendUserGroupRepository->findAll(); should return all
groups, which have the record type set to
Tx_Extbase_Domain_Model-FrontendUserGroup (this can be done in T3 backend).
The assignment to template should work now.
Kind regards
Armin
_______________________________________________
TYPO3-project-typo3v4mvc mailing list
TYPO3-project-typo3v4mvc at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
More information about the TYPO3-project-typo3v4mvc
mailing list