[TYPO3-mvc] Displaying a model property of type 'select' as form field using Extbase and Fluid
Martin Kutschker
masi-no at spam-typo3.org
Wed Jan 20 09:13:11 CET 2010
Thomas "Thasmo" Deinhamer schrieb:
>
> I came accross the fact, that the 'items' to render as select
> field options, are not directly available inside my model,
> nor the action controller dealing with the model.
Me too.
> Furthermore, for a completely localized extension, the items
> inside the TCA config need to be translated, which results
> in defining them with the syntax 'LLL:EXT:MyExt...'. This
> even makes this more complicated, as the strings need to
> be fetched from a locallang file first, for the desired language.
You have that to do in a standard extension as well, because these strings are BE labels. At least I
ended up in duplicating the labels.
> For the question now: Does there exist an easy approach or
> a best-practice already, for getting those TCA items and
> serving them to Fluid? If not, what would be a good solution?
I tried to write a base class for TCA select fields that is meant to act as value object. But I have
only scratched together a few lines of code and never put it to test.
The idea was that the TCA definitions declares an "enum" like class to be used inside the model
(hoping that it would still be persisted). The setter and any action could easily validate the
values. For FLUID I guess a specialized view helper would be needed, but I haven't figured out the
best way to approach the problem.
Masi
More information about the TYPO3-project-typo3v4mvc
mailing list