我正在使用Yii2 DynamicForms 扩展 来创建没有问题的动态字段,但是今天当我运行 composer update 我收到以下错误:
Call to undefined method Symfony\Component\DomCrawler\Crawler::rewind()
错误指向第 201 行/vendor/wbraganca/yii2-dynamicform/DynamicFormWidget.php
:
private function removeItems($content)
{
$document = new \DOMDocument('1.0', \Yii::$app->charset);
$crawler = new Crawler();
$crawler->addHTMLContent($content, \Yii::$app->charset);
$root = $document->appendChild($document->createElement('_root'));
$crawler->rewind(); // Error here
$root->appendChild($document->importNode($crawler->current(), true));
$domxpath = new \DOMXPath($document);
$crawlerInverse = $domxpath->query(CssSelector::toXPath($this->widgetItem));
foreach ($crawlerInverse as $elementToRemove) {
$parent = $elementToRemove->parentNode;
$parent->removeChild($elementToRemove);
}
$crawler->clear();
$crawler->add($document);
return $crawler->filter('body')->eq(0)->html();
}
此方法已从 DomCrawler 中删除?
如何解决这个问题?