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