[TYPO3-mvc] How to use fe_users in my extbase extension?

Roland most.wanted at gmx.at
Wed May 16 11:05:37 CEST 2012


hi everybody,

i try to use fe_users in my extbase extension. i noticed that extbase 
(1.4.3 / TYPO3 4.6) ships with a domain model object "FrontendUser" 
which may/should be used for this purpose.

i set up a basic extension with this controller (i called it 
UserController.php):

--- quote ---

<?php

class Tx_Mitgliederverwaltung_Controller_UserController extends 
Tx_Extbase_MVC_Controller_ActionController {

	/**
	 * @var Tx_Extbase_Domain_Repository_FrontendUserRepository
	 */
	protected $userRepository;
		
	/**
	 * injectUserRepository
	 *
	 * @param Tx_Extbase_Domain_Repository_FrontendUserRepository 
$userRepository
	 * @return void
	 */
	public function 
injectUserRepository(Tx_Extbase_Domain_Repository_FrontendUserRepository 
$userRepository) {
		$this->userRepository = $userRepository;
	}
	
	/**
	 * List action for this controller. Displays a list of users
	 *
	 * @return string The rendered view
	 */
	public function listAction() {
		$this->view->assign('users', $this->userRepository->findAll());
		$this->view->assign('testString', 'Lorem ipsum dolor sit amet.');
	}

}
?>

--- /quote ---

as you can see i assign a "testString" to test if the fluid template 
works. it does work: "Lorem ipsum dolor sit amet." is printed by the 
fluid template.

this is my fluid template:

--- quote ---

<h2>{testString}</h2>
<ul>
	<f:for each="{users}" as="user">
		<li>{user.username}</li>
	</f:for>
</ul>

--- /quote ---

no <li> tag is printed by the fluid template.

did i miss something important?

kind regards.

roland


More information about the TYPO3-project-typo3v4mvc mailing list