class FillPdfRedirectAction in FillPDF 5.0.x
Same name and namespace in other branches
- 8.4 src/Plugin/FillPdfActionPlugin/FillPdfRedirectAction.php \Drupal\fillpdf\Plugin\FillPdfActionPlugin\FillPdfRedirectAction
Action plugin redirecting to a generated PDF file saved to the filesystem.
@package Drupal\fillpdf\Plugin\FillPdfActionPlugin
Plugin annotation
@FillPdfActionPlugin(
id = "redirect",
label = @Translation("Redirect PDF to file")
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\fillpdf\Plugin\FillPdfActionPluginBase implements FillPdfActionPluginInterface
- class \Drupal\fillpdf\Plugin\FillPdfActionPlugin\FillPdfSaveAction
- class \Drupal\fillpdf\Plugin\FillPdfActionPlugin\FillPdfRedirectAction
- class \Drupal\fillpdf\Plugin\FillPdfActionPlugin\FillPdfSaveAction
- class \Drupal\fillpdf\Plugin\FillPdfActionPluginBase implements FillPdfActionPluginInterface
Expanded class hierarchy of FillPdfRedirectAction
File
- src/
Plugin/ FillPdfActionPlugin/ FillPdfRedirectAction.php, line 18
Namespace
Drupal\fillpdf\Plugin\FillPdfActionPluginView source
class FillPdfRedirectAction extends FillPdfSaveAction {
/**
* Executes this plugin.
*
* Saves the PDF file to the filesystem and redirects to it.
*
* @return \Symfony\Component\HttpFoundation\RedirectResponse
* Redirects user to the generated PDF file, or if saving the file fails,
* to the front page.
*
* @todo Replace file_create_url() by File::createFileUrl() once we're not
* supporting Drupal 8.6 anymore.
*/
public function execute() {
$saved_file = $this
->savePdf();
$url = $saved_file !== FALSE ? file_create_url($saved_file
->getFileUri()) : Url::fromRoute('<front>')
->toString();
return new RedirectResponse($url);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FillPdfActionPluginBase:: |
public | function |
Calculates dependencies for the configured plugin. Overrides DependentPluginInterface:: |
|
FillPdfActionPluginBase:: |
public | function | Gets default configuration for this plugin. | |
FillPdfActionPluginBase:: |
public | function | Gets this plugin's configuration. | |
FillPdfActionPluginBase:: |
public | function |
@todo Remove once drupal:8.6.x is no longer supported. Overrides PluginBase:: |
|
FillPdfActionPluginBase:: |
public | function | Sets the configuration for this plugin instance. | |
FillPdfRedirectAction:: |
public | function |
Executes this plugin. Overrides FillPdfSaveAction:: |
|
FillPdfSaveAction:: |
protected | property | The FillPdf output handler. | |
FillPdfSaveAction:: |
public static | function |
Creates an instance of the plugin. Overrides FillPdfActionPluginBase:: |
|
FillPdfSaveAction:: |
protected | function | Saves merged PDF data to the filesystem. | |
FillPdfSaveAction:: |
public | function |
Constructs a \Drupal\Component\Plugin\PluginBase object. Overrides PluginBase:: |
|
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
2 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |