forked from hechoendrupal/drupal-console
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPluginRestResourceGenerator.php
More file actions
37 lines (34 loc) · 998 Bytes
/
Copy pathPluginRestResourceGenerator.php
File metadata and controls
37 lines (34 loc) · 998 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/**
* @file
* Contains \Drupal\AppConsole\Generator\PluginRestResourceGenerator.
*/
namespace Drupal\AppConsole\Generator;
class PluginRestResourceGenerator extends Generator
{
/**
* Generator Plugin Block
* @param $module
* @param $class_name
* @param $plugin_label
* @param $plugin_id
* @param $plugin_url
* @param $plugin_states
*/
public function generate($module, $class_name, $plugin_label, $plugin_id, $plugin_url, $plugin_states)
{
$parameters = [
'module_name' => $module,
'class_name' => $class_name,
'plugin_label' => $plugin_label,
'plugin_id' => $plugin_id,
'plugin_url' => $plugin_url,
'plugin_states' => $plugin_states,
];
$this->renderFile(
'module/src/Plugin/Rest/Resource/rest.php.twig',
$this->getPluginPath($module, 'rest') . '/resource/' . $class_name . '.php',
$parameters
);
}
}