您好,我在为动作提供表单中填充的对象时遇到了麻烦:我可以加载表单并使用在show动作中准备的对象填充它,但是当我将其提交给表单以存储表单时对象表单内容不会在action方法参数中传递,而是在请求参数中的数组中传递。因此,似乎模型类是正确的,形式是正确的,并且第一个动作是正确的,但是流体形式中缺少某些内容或该动作中有错误。关于寻找导致问题的原因的任何建议?提前致谢。 这是加载表格的控制器
/**
* @param \Aip\AipMediakey\Domain\Model\Subscriptions $newSubscription
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\NoSuchArgumentException
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException
*/
public function iscrizioneAwardFirstStepAction(\Aip\AipMediakey\Domain\Model\Subscriptions $newSubscription = NULL)
{
.....
$newSubscription = $this->objectManager->get('Aip\AipMediakey\Domain\Model\Subscriptions');
/** @var \Aip\AipMediakey\Domain\Model\Subscriptions $newSubscription */
$newSubscription->setCampaignTitle('');
$newSubscription->setProductName('');
$this->view->assign('newSubscription', $newSubscription);
.....
这是流体形式
<f:form action="iscrizioneAwardStepSoggetti" object="{newSubscription}" name="newSubscription" >
<f:form.hidden property="eventId" value="{award.uid}"/>
Iscrizione all'award : {award.title}
Campagna <br>
Titolo Campagna <f:form.textfield property="campaignTitle" /> <br>
NomeProdotto <f:form.textfield property="productName" /> <br>
<f:form.button type="submit" name="Indietro" value="indietro" formmethod="post">Indietro</f:form.button>
<f:form.button type="submit" name="Procedi" value="procedi" formmethod="post">Procedi</f:form.button>
</f:form>
此操作称为提交表单:
/**
* @param \Aip\AipMediakey\Domain\Model\Subscriptions $newSubscription
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
*/
public function IscrizioneAwardStepSoggettiAction(\Aip\AipMediakey\Domain\Model\Subscriptions $newSubscription = NULL)
{
$this->subscriptionsRepository->add($newSubscription);
}
答案 0 :(得分:0)
我发现了我的错误,方法
IscrizioneAwardStepSoggettiAction
应该被命名
iscrizioneAwardStepSoggettiAction(以小写字母i开头)
如ext_local_conf.php中所述
我希望至少这个答案可以帮助其他人。