public function TwoCheckout::getDisplayLabel in Ubercart 8.4
Returns the payment method label with logo.
Parameters
string $label: The payment method label to be styled.
Return value
array A render array containing the formatted payment method label.
Overrides PaymentMethodPluginBase::getDisplayLabel
File
- payment/
uc_2checkout/ src/ Plugin/ Ubercart/ PaymentMethod/ TwoCheckout.php, line 25
Class
- TwoCheckout
- Defines the 2Checkout payment method.
Namespace
Drupal\uc_2checkout\Plugin\Ubercart\PaymentMethodCode
public function getDisplayLabel($label) {
$build['#attached']['library'][] = 'uc_2checkout/2checkout.styles';
$build['label'] = [
'#plain_text' => $label,
'#suffix' => '<br />',
];
$build['image'] = [
'#theme' => 'image',
'#uri' => drupal_get_path('module', 'uc_2checkout') . '/images/2co_logo.jpg',
'#alt' => $this
->t('2Checkout'),
'#attributes' => [
'class' => [
'uc-2checkout-logo',
],
],
];
return $build;
}