Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
BackButton Class Reference
Inheritance diagram for BackButton:
ButtonProviderInterface

Public Member Functions

 __construct (Context $context)
 
 getButtonData ()
 
 getBackUrl ()
 

Protected Attributes

 $urlBuilder
 

Detailed Description

"Back" button data provider

@api

Since
100.1.0

Definition at line 18 of file BackButton.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( Context  $context)
Parameters
Context$context

Definition at line 31 of file BackButton.php.

33  {
34  $this->urlBuilder = $context->getUrlBuilder();
35  }

Member Function Documentation

◆ getBackUrl()

getBackUrl ( )

Get URL for back (reset) button

Returns
string
Since
100.1.0

Definition at line 57 of file BackButton.php.

58  {
59  return $this->urlBuilder->getUrl('*/*/');
60  }

◆ getButtonData()

getButtonData ( )

Retrieve button-specified settings

Returns
array

Since
100.1.0

Implements ButtonProviderInterface.

Definition at line 41 of file BackButton.php.

42  {
43  return [
44  'label' => __('Back'),
45  'on_click' => sprintf("location.href = '%s';", $this->getBackUrl()),
46  'class' => 'back',
47  'sort_order' => 10
48  ];
49  }
__()
Definition: __.php:13

Field Documentation

◆ $urlBuilder

$urlBuilder
protected

Definition at line 26 of file BackButton.php.


The documentation for this class was generated from the following file: