コード例 #1
0
 /**
  * DeleteButton constructor.
  *
  * @param Context  $context
  * @param Registry $registry
  * @param          $registryIdKey
  * @param string   $requestIdParam
  * @param string   $deleteAction
  * @param array    $buttonData
  */
 public function __construct(Context $context, Registry $registry, $registryIdKey, $requestIdParam = 'id', $deleteAction = '*/*/delete', array $buttonData = [])
 {
     parent::__construct($context, $registry, $registryIdKey, $buttonData);
     $this->buttonData['data_attribute'] = ['url' => $this->getDeleteUrl($deleteAction, $requestIdParam)];
 }
コード例 #2
0
 /**
  * BackButton constructor.
  *
  * @param Context  $context
  * @param Registry $registry
  * @param          $registryIdKey
  * @param array    $backUrl
  * @param array    $buttonData
  */
 public function __construct(Context $context, Registry $registry, $registryIdKey, $backUrl, array $buttonData = [])
 {
     parent::__construct($context, $registry, $registryIdKey, $buttonData);
     $this->buttonData['on_click'] = sprintf("location.href = '%s';", $backUrl);
 }