[TYPO3-mvc] HowTo output usergroup from fe_user
Heinz Schilling
webdesign at webtekk.ch
Wed May 1 18:56:23 CEST 2013
Hi
I tried several tips from the internet but nothing works. I extend fe_user in my Extbase 6.0 / Fluid 6.0 Extension and want to output usergroup.
File: Vendor/Myextension/Classes/Domain/Model/User.php
class User extends \TYPO3\CMS\Extbase\Domain\Model\FrontendUser {
}
File: Vendor/Myextension/Classes/Domain/Repository/UserRepository.php
class UserRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
}
File: Vendor/Myextension/Classes/Controller/UserController.php
class UserController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
/**
* userRepository
*
* @var \Vendor\Myextension\Domain\Repository\UserRepository
* @inject
*/
protected $userRepository;
/**
* action list
*
* @return void
*/
public function listAction() {
$users = $this->userRepository->findAll();
$this->view->assign('users', $users);
}
}
File: Vendor/Myextension/Configuration/TypoScript/setup.txt
plugin.tx_myextension {
persistence {
classes {
Vendor\Myextension\Domain\Model\User {
mapping {
tableName = fe_users
recordType = Tx_Extbase_Domain_Model_FrontendUser
}
}
}
}
}
File: Vendor/Myextension/Resources/Private/Templates/User/list.html
<table>
<f:for each="{users}" as="user">
<tr>
<td>{user.username}</td>
<td>{user.password}</td>
<td>{user.usergroup.title}</td>
<td>{user.usergroup.description}</td>
</tr>
</f:for>
</table>
Result:
Works: {user.username}, {user.password}
No output: {user.usergroup.title}, {user.usergroup.description}
What did I miss? I hope, someone can help.
Greetings, Heinz
More information about the TYPO3-project-typo3v4mvc
mailing list