當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Form::set方法代碼示例

本文整理匯總了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;
 }
開發者ID:joelpittet,項目名稱:dopatchutils,代碼行數:11,代碼來源:DoFormBase.php

示例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);
 }
開發者ID:kitsunet,項目名稱:form,代碼行數:13,代碼來源:AbstractFunctionalTestCase.php

示例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;
 }
開發者ID:kea,項目名稱:PUGXCmfPageBundle,代碼行數:31,代碼來源:PageAdminTest.php

示例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;
 }
開發者ID:adam-paterson,項目名稱:orocommerce,代碼行數:23,代碼來源:AccountAddressControllerTest.php


注:本文中的Symfony\Component\DomCrawler\Form::set方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。