[TYPO3-mvc] extbase: definition and output of a model function

Henjo Hoeksma me at henjohoeksma.nl
Thu Mar 1 16:36:05 CET 2012


Hi Kerstin,

looks correct to me. (Domain Object Properties can be called in the view by
{object.property}).

However my question would more be if you use Domain Modeling correctly.
Free vacancies within an object as a property seems wrong to me. I do not
know your model, but I would start to think that a vacancy should be
related to an order/reservation and there is a max number of reservations
to your event. That would change things in your model.

But again I don't know your model ;-)

Kind regards,

Henjo

Problems are small because we learned how to deal with them.
Problems are big because we need to learn how to deal with them.


On Thu, Mar 1, 2012 at 11:30, Kerstin Eitner
<eitner.kerstin at googlemail.com>wrote:

> Hi there,
>
> i've got a question concerning the definition and output of a model
> function.
>
> E.g.
> In my Event-Model i've got a function that calculates the number of free
> vacancies.
>
> public function getFreevacancies() {
>        ...
>        return $result;
> }
>
> How can i call the function in my Event-View?
>
> I've determined that I have to declare a variable in my model
> ($freevacancies) and then i can output that in my view like
> {event.freevacancies}.
>
>
> Is that the right way or how is this done correctly?
>
>
>
> Thanks in advance!
>
> Greetz
> Kerstin
> ______________________________**_________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc@**lists.typo3.org<TYPO3-project-typo3v4mvc at lists.typo3.org>
> http://lists.typo3.org/cgi-**bin/mailman/listinfo/typo3-**
> project-typo3v4mvc<http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc>
>


More information about the TYPO3-project-typo3v4mvc mailing list