[TYPO3-mvc] [INFO] How-to do AJAX with Extbase
Robert Lemke
robert at typo3.org
Mon Aug 3 14:32:04 CEST 2009
Hi Xavier,
Am 03.08.2009 um 11:43 schrieb Xavier Perseguers:
> As you said it's for FLOW3. I'm not sure it exists for Extbase.
it doesn't - I only wanted to raise that topic ....
>> Some untested sample code (note the small name changes):
>>
>> class Tx_MvcExtjsSamples_Controller_GenreController {
>>
>> public function indexAction() {
>> $genreRepository =
>> t3lib_div
>> ::makeInstance
>> ('Tx_MvcExtjsSamples_Domain_Repository_GenreRepository');
>>
>> $genres = $genreRepository->findAll();
>> $this->view->assign('genres', $genres);
>> }
>>
>> }
>>
>> index.html:
>> <ul>
>> <f:for each="{genres}" as "genre">
>> <li>{genre.title}</li>
>> </f:for>
>> <ul>
>>
>> index.json:
>> {namespace mvcextjs=Tx_MvcExtjsSamples_ViewHelpers}
>> <mvcextjs:json>{genres}</mvcextjs:json>
>
> Yes the difference is only in the file extension, which would be much
> better but needs support from Extbase.
yes and did you not the different controller and action name?
Of course it's a matter of taste and somewhat depends on the situation
but I'd prefer "GenreController::indexAction" over
"FooController::genresAction".
Cheers,
robert
More information about the TYPO3-project-typo3v4mvc
mailing list