假设页面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
在浏览器上以 value 提交<p>Hello</p>
;
但使用以下代码:
$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
以价值提交&lt;p&gt; &lt;/p&gt;
客户端 [ \Symfony\Bundle\FrameworkBundle\Client
] 是否应该在调用提交之前解码表单数据?我错过了什么吗?
谢谢