[TYPO3-mvc] Tx_Extbase_MVC_Exception_InfiniteLoop - again
Bernhard Kraft
kraftb at think-open.at
Thu May 6 09:10:08 CEST 2010
Thilo Schneider wrote:
> createAction(Tx_Gemeindenachrichten_Domain_Model_Termin $newTermin =
> NULL, $vonhour, $vonminute, $bishour, $bisminute, $datum)
>
> The action is called by the following form:
> <f:form method="post" action="create" controller="Termin"
> name="newTermin" object="{newTermin}">
> <f:form.hidden name="datum"
> value="<f:format.date>{tag.datum}</f:format.date>"/>
> <f:form.textbox name="vonhour" class="edit"/>
> <f:form.textbox name="vonminute" class="edit"/>
Hello !
I am not completly sure. But I guess in your example you would like to
create a new repository entry of the type "Termin". Instead of handling
all parameters (vonhour, vonminute, bishour, etc.) on it's own, I think
it is common practice to let all this get handled by the Domain Model
class. I create an extension which has to store bookmarks and defined
the create/add action function like following:
/**
* Adds a bookmark to the repository
*
* @param Tx_VoegeleBookmark_Domain_Model_Bookmark $newBookmark A new
bookmark object which has not yet been added to the repository
* @return void
* @dontvalidate $newBookmark
*/
public function addAction(Tx_VoegeleBookmark_Domain_Model_Bookmark
$newBookmark) {
So only one parameter "newBookmark" gets passed which will contain all
values from the form. The form looks like:
-------------
<f:section name="content">
<f:form method="post" controller="Bookmark" action="add"
name="newBookmark" object="{newBookmark}">
<f:form.hidden id="bookmark_cookie" property="cookie" />
<f:form.hidden id="bookmark_link" property="link" />
</f:form>
</f:section>
-------------
You sometimes use "name=" on your fields and sometimes "property=". I do
not know if those vonhour, bishour parameters are part of the class
"Tx_Gemeindenachrichten_Domain_Model_Termin" but if they are you should
simply use the "propery=" argument so you do not have to care about
every parameter on its own:
> <f:form.textbox name="bisminute" class="edit"/>
> <f:form.textarea property="beschreibung" id="content"/>
If those extra parameters are something not stored in the domain model
just forget my mail - then it seems I did just not understand your
application.
greets,
Bernhard
More information about the TYPO3-project-typo3v4mvc
mailing list