本文整理匯總了PHP中Symfony\Component\DomCrawler\Form::getNode方法的典型用法代碼示例。如果您正苦於以下問題:PHP Form::getNode方法的具體用法?PHP Form::getNode怎麽用?PHP Form::getNode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Symfony\Component\DomCrawler\Form
的用法示例。
在下文中一共展示了Form::getNode方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: fillFormForUpdateTest
/**
* Fill form for address tests (update test)
*
* @param Form $form
* @return Form
*/
protected function fillFormForUpdateTest(Form $form)
{
$formNode = $form->getNode();
$formNode->setAttribute('action', $formNode->getAttribute('action') . '?_widgetContainer=dialog');
$form['orob2b_account_typed_address[types]'] = [AddressType::TYPE_BILLING, AddressType::TYPE_SHIPPING];
$form['orob2b_account_typed_address[defaults][default]'] = [false, AddressType::TYPE_SHIPPING];
$doc = new \DOMDocument("1.0");
$doc->loadHTML('<select name="orob2b_account_typed_address[country]" id="orob2b_account_typed_address_country" ' . 'tabindex="-1" class="select2-offscreen"> ' . '<option value="" selected="selected"></option> ' . '<option value="ZW">Zimbabwe</option> </select>');
$field = new ChoiceFormField($doc->getElementsByTagName('select')->item(0));
$form->set($field);
$form['orob2b_account_typed_address[country]'] = 'ZW';
$doc->loadHTML('<select name="orob2b_account_typed_address[region]" id="orob2b_account_typed_address_region" ' . 'tabindex="-1" class="select2-offscreen"> ' . '<option value="" selected="selected"></option> ' . '<option value="ZW-MA">Manicaland</option> </select>');
$field = new ChoiceFormField($doc->getElementsByTagName('select')->item(0));
$form->set($field);
$form['orob2b_account_typed_address[region]'] = 'ZW-MA';
return $form;
}