本文整理汇总了PHP中WellCommerce\Component\Form\Elements\FormInterface类的典型用法代码示例。如果您正苦于以下问题:PHP FormInterface类的具体用法?PHP FormInterface怎么用?PHP FormInterface使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FormInterface类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildForm
/**
* {@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'));
}
示例2: buildForm
/**
* {@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'));
}
示例3: buildForm
/**
* {@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'));
}
示例4: buildForm
/**
* {@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'));
}
示例5: buildForm
/**
* {@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'));
}
示例6: buildForm
/**
* {@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'));
}
示例7: buildForm
/**
* {@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'));
}
示例8: buildForm
/**
* {@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'));
}
示例9: buildForm
/**
* {@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'));
}
示例10: buildForm
/**
* {@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'));
}
示例11: isValid
/**
* {@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;
}
示例12: buildForm
/**
* {@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'));
}
示例13: buildForm
/**
* {@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'));
}
示例14: addShippingOptions
/**
* 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']]));
}
}
}
示例15: buildForm
/**
* {@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'));
}