php WellCommerce-Component-Form-Elements-FormInterface类(方法)实例源码

下面列出了php WellCommerce-Component-Form-Elements-FormInterface 类(方法)源码代码实例,从而了解它的用法。

作者:wellcommerc    项目:wellcommerc   
/**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $form->addChild($this->getElement('text_area', ['name' => 'comment', 'rows' => 5, 'cols' => 20, 'label' => $this->trans('order.label.comment')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }

作者:pgus    项目:WellCommerc   
/**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $form->addChild($this->getElement('text_field', ['name' => '_username', 'label' => $this->trans('client.label.username')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }

作者:Newman10    项目:WellCommerc   
/**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $contactDetails = $form->addChild($this->getElement('nested_fieldset', ['name' => 'clientDetails', 'label' => $this->trans('client.heading.client_details')]));
     $contactDetails->addChild($this->getElement('text_field', ['name' => 'clientDetails.password', 'label' => $this->trans('client.label.new_password')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }

作者:pgus    项目:WellCommerc   
/**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('fieldset', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general')]));
     $requiredData->addChild($this->getElement('image', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general'), 'datagrid' => $this->get('media.datagrid')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }

作者:Newman10    项目:WellCommerc   
/**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general')]));
     $requiredData->addChild($this->getElement('select', ['name' => 'code', 'label' => $this->trans('currency.label.code'), 'options' => $this->repository->getCurrenciesToSelect()]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }

作者:Sywooc    项目:WellCommerc   
/**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'general_settings', 'label' => $this->trans('common.fieldset.general')]));
     $languageData = $requiredData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('form.fieldset.translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('availability.repository'))]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('common.label.name'), 'rules' => [$this->getRule('required')]]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }

作者:Newman10    项目:WellCommerc   
/**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general')]));
     $requiredData->addChild($this->getElement('select', ['name' => 'code', 'label' => $this->trans('locale.label.code'), 'options' => $this->get('locale.repository')->getLocaleNames()]));
     $requiredData->addChild($this->getElement('select', ['name' => 'currency', 'label' => $this->trans('locale.label.currency'), 'options' => $this->get('currency.dataset.admin')->getResult('select', [], ['label_column' => 'code']), 'transformer' => $this->getRepositoryTransformer('entity', $this->get('currency.repository'))]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }

作者:wellcommerc    项目:wellcommerc   
/**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general')]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('common.label.name'), 'rules' => [$this->getRule('required')]]));
     $requiredData->addChild($this->getElement('select', ['name' => 'folder', 'label' => $this->trans('theme.label.folder'), 'comment' => $this->trans('theme.comment.folder'), 'options' => $this->get('theme.locator')->getThemeFolders()]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }

作者:Newman10    项目:WellCommerc   
/**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('fieldset.required_data.label')]));
     $languageData = $requiredData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('fieldset.translations.label'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('order_status_group.repository'))]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('order_status_group.label.name')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }

作者:Sywooc    项目:WellCommerc   
/**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general')]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('common.label.name'), 'rules' => [$this->getRule('required')]]));
     $requiredData->addChild($this->getElement('rights_table', ['name' => 'permissions', 'label' => $this->trans('user_group.label.permissions'), 'actions' => $this->getPermissionActions(), 'controllers' => $this->getPermissionTypes(), 'transformer' => $this->getRepositoryTransformer('user_group_permission', $this->get('user_group.repository'))]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }

作者:Newman10    项目:WellCommerc   
/**
  * {@inheritdoc}
  */
 public function isValid(FormInterface $form)
 {
     $errors = $this->validator->validate($form->getModelData(), null, $form->getValidationGroups());
     if ($errors->count()) {
         $this->constraintViolationMapper->mapErrorsToForm($errors, $form);
         return false;
     }
     return true;
 }

作者:Sywooc    项目:WellCommerc   
/**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $unitForm)
 {
     $channelRequiredData = $unitForm->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general')]));
     $channelRequiredData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('common.label.name'), 'rules' => [$this->getRule('required')]]));
     $channelRequiredData->addChild($this->getElement('text_field', ['name' => 'url', 'label' => $this->trans('common.label.url'), 'rules' => [$this->getRule('required')]]));
     $unitForm->addFilter($this->getFilter('no_code'));
     $unitForm->addFilter($this->getFilter('trim'));
     $unitForm->addFilter($this->getFilter('secure'));
 }

作者:WellCommerc    项目:CurrencyBundl   
/**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general')]));
     $requiredData->addChild($this->getElement('select', ['name' => 'code', 'label' => $this->trans('currency.label.code'), 'options' => $this->getCurrencyRepository()->getCurrenciesToSelect(), 'default' => $this->getRequestHelper()->getCurrentCurrency()]));
     $requiredData->addChild($this->getElement('checkbox', ['name' => 'enabled', 'label' => $this->trans('common.label.enabled'), 'comment' => $this->trans('currency.comment.enabled')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }

作者:WellCommerc    项目:OrderBundl   
/**
  * Adds shipping options if available for order's shipping method
  *
  * @param OrderInterface $order
  * @param FormInterface  $form
  */
 private function addShippingOptions(OrderInterface $order, FormInterface $form)
 {
     if ($order->hasShippingMethod()) {
         $provider = $this->getOptionsProvider($order->getShippingMethod());
         if ($provider instanceof ShippingMethodOptionsProviderInterface) {
             $form->addChild($this->getElement('select', ['name' => 'shippingMethodOption', 'label' => $this->trans('order.label.shipping_method'), 'options' => ['Wybierz sklep', 'Kraków', 'Warszawa']]));
         }
     }
 }

作者:pgus    项目:WellCommerc   
/**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $unitForm)
 {
     $unitRequiredData = $unitForm->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general')]));
     $unitTranslationData = $unitRequiredData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('form.fieldset.translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('product.repository'))]));
     $unitTranslationData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('common.label.name')]));
     $unitForm->addFilter($this->getFilter('no_code'));
     $unitForm->addFilter($this->getFilter('trim'));
     $unitForm->addFilter($this->getFilter('secure'));
 }

作者:pgus    项目:WellCommerc   
/**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general')]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'identifier', 'label' => $this->trans('dictionary.label.identifier')]));
     $languageData = $requiredData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('form.fieldset.translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('dictionary.repository'))]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'value', 'label' => $this->trans('dictionary.label.value')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }

作者:wellcommerc    项目:wellcommerc   
/**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general')]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'discount', 'label' => $this->trans('common.label.discount'), 'comment' => $this->trans('client.comment.discount'), 'suffix' => '%', 'filters' => [$this->getFilter('comma_to_dot_changer')], 'rules' => [$this->getRule('required')]]));
     $languageData = $requiredData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('common.fieldset.translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('client_group.repository'))]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('common.label.name'), 'rules' => [$this->getRule('required')]]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }

作者:pgus    项目:WellCommerc   
/**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $mainData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general')]));
     $mainData->addChild($this->getElement('text_field', ['name' => 'nick', 'label' => $this->trans('product_review.label.nick')]));
     $mainData->addChild($this->getElement('text_field', ['name' => 'rating', 'label' => $this->trans('product_review.label.rating')]));
     $mainData->addChild($this->getElement('text_area', ['name' => 'review', 'label' => $this->trans('product_review.label.review'), 'rows' => 5, 'cols' => 10]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }

作者:wellcommerc    项目:wellcommerc   
/**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $taxForm)
 {
     $taxRequiredData = $taxForm->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general')]));
     $taxTranslationData = $taxRequiredData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('common.fieldset.translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('tax.repository'))]));
     $taxTranslationData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('common.label.name'), 'rules' => [$this->getRule('required')]]));
     $taxRequiredData->addChild($this->getElement('text_field', ['name' => 'value', 'label' => $this->trans('tax.label.value'), 'suffix' => '%', 'rules' => [$this->getRule('required')]]));
     $taxForm->addFilter($this->getFilter('no_code'));
     $taxForm->addFilter($this->getFilter('trim'));
     $taxForm->addFilter($this->getFilter('secure'));
 }

作者:wellcommerc    项目:wellcommerc   
/**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general')]));
     $languageData = $requiredData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('common.fieldset.translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('layout_box.repository'))]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('layout_box.label.name'), 'rules' => [$this->getRule('required')]]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'identifier', 'label' => $this->trans('layout_box.label.identifier'), 'comment' => $this->trans('layout_box.comment.identifier'), 'rules' => [$this->getRule('required')]]));
     $requiredData->addChild($this->getElement('select', ['name' => 'boxType', 'label' => $this->trans('layout_box.label.box_type')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }


问题


面经


文章

微信
公众号

扫码关注公众号