【发布时间】:2013-06-10 11:01:14
【问题描述】:
假设页面http://test.intra具有以下表单代码:
<form>
<textarea id="description" name="description"><p>Hello</p></textarea>
<input type="submit" name="submit_save" id='submit_btn' value="Save">
</form>
description field 在浏览器上提交,值为&lt;p&gt;Hello&lt;/p&gt;
但使用以下代码:
$crawler = $client->request('GET', 'http://test.intra');
/* $client is a instance of \Symfony\Bundle\FrameworkBundle\Client ]
* $crawler is a instance of \Symfony\Component\DomCrawler\Crawler
*/
$domForm = $crawler->filter('form');
$domForm = $domForm->selectButton('submit_btn');
$this->client->submit($form);
description field 以值&amp;lt;p&amp;gt; &amp;lt;/p&amp;gt; 提交
客户端 [\Symfony\Bundle\FrameworkBundle\Client] 应该在调用提交之前解码表单数据吗?我错过了什么吗?
谢谢
【问题讨论】:
标签: html forms symfony web-crawler richtext