[TYPO3-mvc] how to convert flag/type and bitmask values for output in the view
Martin Kutschker
masi-no at spam-typo3.org
Sun Dec 27 12:07:19 CET 2009
Hi!
I don't know if I am not yet in the right ExtBase/FLUID spirit or have missed the bits form the docs
but I cannot solve the riddles on how tackle a few of the common tasks in plugin creation.
a) Assume I have a person object with a gender property which can have the internal values of 0
(unknown), 1 (male, 2 (female), 9 (not appicable, eg company) on accordance to ISO 5218
In the TCA I can set up a "select" field with a fixed list of items. What is the easiest way to get
a localizable output in FLUID? In a "classic" TYPO3 I would turn the value (of the record array)
into a locallang key and call the LL functions with it.
I think that I can do it on my own by adding a getSex() method to the view. But I was hoping to find
some helpers in ExtBase or FLUID to assist me in the task. But where are they?
b) The same as a) but about booleans (yes/no checkboxes in the TCA). Eg the person could have a
"subscribed to newsletter" property.
c) Yet again the same as a) but about bitmasks (group of checkboxes). Perhaps the person object may
have interests and we know that the list of possible interests our application wants to know about
is fixed. Yes, I could use a relation but I cannot think of a better example now.
Masi
More information about the TYPO3-project-typo3v4mvc
mailing list