[TYPO3-dev] Good practise for controller actions in general scope
Klaus Heuer
post at heuer-illustration.de
Mon Jan 6 22:02:58 CET 2014
Hi List,
I have some logical trouble with an extbase action which is needed in
different controllers.
I have an ajax/page-type request whicht I need in different conrollers -
e.g. a product detail page which is loaded as an overlay in different
views/controllers by jquery / ajax.
Normally I will move such stuff to a class in the utility folder and
inject it in each controller. But in this case, I return a filled
template an not a json string to the jquery request and this will not
work with "utility classes".
So, what ist the best way?
- Copy the function (an even the template) to each Controller/Template Set?
- Inject a controller class by an other controller?
- Work with an abstract class (with repository injects in the abstract
class?)
- Move it to an utility class an work with an json return (and build the
template in the jquery function?)
..... I feel not really comfortable with each of this options
I think there must be smarter way :)
Thanks, Klaus
More information about the TYPO3-dev
mailing list