Advertisement
Guest User

Untitled

a guest
May 26th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. // appcode[Vendor][Module]BlockAdminhtmlPointEditForm.php
  2.  
  3. $balloonFieldset->addField(
  4. 'payment_types',
  5. 'checkboxes',
  6. [
  7. 'label' => __('Payment Types'),
  8. 'name' => 'payment_types',
  9. 'values' => [
  10. ['value' => '2','label' => 'Card'],
  11. ['value' => '3','label' => 'Cash'],
  12. ['value' => '4','label' => 'Prepaid'],
  13. ],
  14. ]
  15. );
  16.  
  17. /**
  18. * Set payment_types
  19. *
  20. * @param array $paymentTypes
  21. * @return RoundropFrontPageApiDataPointInterface
  22. */
  23. public function setPaymentTypes($paymentTypes)
  24. {
  25. $stringTypes = implode(', ', $paymentTypes);
  26.  
  27. return $this->setData(self::PAYMENT_TYPES, $stringTypes);
  28. }
  29.  
  30. /**
  31. * Get payment types
  32. *
  33. * @return string|null
  34. */
  35. public function getPaymentTypes()
  36. {
  37. return explode(', ', $this->getData(self::PAYMENT_TYPES));
  38. }
  39.  
  40. 'name' => 'payment_types',
  41.  
  42. 'name' => 'payment_types[]',
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement