1 | <?php |
||
16 | class ConfirmationFormCreator implements FormCreatorInterface |
||
17 | { |
||
18 | /** |
||
19 | * The primary action of the form (e.g. "Yes" or "Delete"), shown to the user |
||
20 | * @var string |
||
21 | */ |
||
22 | private $action; |
||
23 | |||
24 | /** |
||
25 | * The URL where the form should redirect on cancellation |
||
26 | * @var string |
||
27 | */ |
||
28 | private $originalUrl; |
||
29 | |||
30 | /** |
||
31 | * Whether to show "No" instead of cancel |
||
32 | * @var bool |
||
33 | */ |
||
34 | private $no; |
||
35 | |||
36 | /** |
||
37 | * Whether or not the confirmation is for a destructive action |
||
38 | * @var bool |
||
39 | 1 | */ |
|
40 | private $destructive; |
||
41 | 1 | ||
42 | 1 | /** |
|
43 | 1 | * Create a new confirmation form |
|
44 | 1 | * @param string $action The text to show on the "Yes" button |
|
45 | * @param string $originalUrl The URL which the user is coming from |
||
46 | * @param bool $no Whether to show "No" instead of cancel |
||
47 | * @param bool $destructive Whether or not to mark the action button as being a destructive operation |
||
48 | */ |
||
49 | 1 | public function __construct($action, $originalUrl, $no = false, $destructive = false) |
|
56 | |||
57 | 1 | /** |
|
58 | 1 | * {@inheritdoc} |
|
59 | 1 | */ |
|
60 | public function create() |
||
89 | } |
||
90 |