本文整理匯總了PHP中Symfony\Component\DomCrawler\Form::set方法的典型用法代碼示例。如果您正苦於以下問題:PHP Form::set方法的具體用法?PHP Form::set怎麽用?PHP Form::set使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Symfony\Component\DomCrawler\Form
的用法示例。
在下文中一共展示了Form::set方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setStatus
/**
* @param integer $value
* @return $this
*/
protected function setStatus($value)
{
$status = $this->form->get('field_issue_status[und]');
$status->setValue($value);
$this->form->set($status);
return $this;
}
示例2: gotoPreviousFormPage
/**
* Go to the previous form page
*
* @param \Symfony\Component\DomCrawler\Form $form
* @return \TYPO3\Flow\Http\Response
*/
protected function gotoPreviousFormPage(\Symfony\Component\DomCrawler\Form $form)
{
$previousButton = $this->browser->getCrawler()->filterXPath('//nav[@class="form-navigation"]/*/*[contains(@class, "previous")]/button');
$previousButton->rewind();
$form->set(new InputFormField($previousButton->current()));
return $this->browser->submit($form);
}
示例3: addMenuItemForm
/**
* @param Form $form
* @param $code
* @param $elementId
* @return Crawler
*/
private function addMenuItemForm(Form $form, $code, $elementId)
{
$ajaxClient = static::createClient();
$ajaxCrawler = $ajaxClient->request('POST', '/admin/core/append-form-field-element', array_merge($form->getPhpValues(), array('code' => $code, 'elementId' => 'page_' . $elementId, 'uniqid' => 'page')));
foreach ($ajaxCrawler->filter('input') as $node) {
if ($node->attributes->getNamedItem('type')) {
if ($node->attributes->getNamedItem('type')->nodeValue == 'checkbox' || $node->attributes->getNamedItem('type')->nodeValue == 'radio') {
$form->set(new ChoiceFormField($node));
continue;
}
if ($node->attributes->getNamedItem('type') == 'file') {
$form->set(new FileFormField($node));
continue;
}
}
$form->set(new InputFormField($node));
}
foreach ($ajaxCrawler->filter('select') as $node) {
$form->set(new ChoiceFormField($node));
}
foreach ($ajaxCrawler->filter('textarea') as $node) {
$form->set(new TextareaFormField($node));
}
return $ajaxCrawler;
}
示例4: 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;
}