1 | <?php |
||
23 | class ExportableAction extends Action |
||
24 | { |
||
25 | /** |
||
26 | * @var string is the filename of the file to be downloaded. Defaults to "exportable" |
||
27 | */ |
||
28 | public $fileName = 'exportable'; |
||
29 | /** |
||
30 | * @var \Closure an anonymous function that is called once BEFORE forcing download. The return result of the |
||
31 | * function will be rendered on the file. It should have the following signature: |
||
32 | * |
||
33 | * ```php |
||
34 | * function ($type){} |
||
35 | * ``` |
||
36 | * |
||
37 | * - `type`: Is the format type to download. The anonymous function should return the content on the selected |
||
38 | * format. |
||
39 | */ |
||
40 | public $contentValue; |
||
41 | /** |
||
42 | * @var DownloadServiceInterface |
||
43 | */ |
||
44 | public $downloadService; |
||
45 | |||
46 | /** |
||
47 | * @inheritdoc |
||
48 | */ |
||
49 | public function init() |
||
59 | |||
60 | /** |
||
61 | * @throws BadRequestHttpException |
||
62 | * @return array|mixed |
||
63 | */ |
||
64 | public function run() |
||
78 | } |
||
79 |