X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdrupal%2Fconsole%2Fsrc%2FGenerator%2FPluginViewsFieldGenerator.php;fp=vendor%2Fdrupal%2Fconsole%2Fsrc%2FGenerator%2FPluginViewsFieldGenerator.php;h=3d0d036813e1e863c312c7c98bdea445be67c971;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/vendor/drupal/console/src/Generator/PluginViewsFieldGenerator.php b/vendor/drupal/console/src/Generator/PluginViewsFieldGenerator.php new file mode 100644 index 000000000..3d0d03681 --- /dev/null +++ b/vendor/drupal/console/src/Generator/PluginViewsFieldGenerator.php @@ -0,0 +1,62 @@ +extensionManager = $extensionManager; + } + + /** + * Generator Plugin Field Formatter. + * + * @param string $module Module name + * @param string $class_name Plugin Class name + * @param string $label Plugin label + * @param string $plugin_id Plugin id + * @param string $field_type Field type this formatter supports + */ + public function generate($module, $class_machine_name, $class_name, $title, $description) + { + $parameters = [ + 'module' => $module, + 'class_machine_name' => $class_machine_name, + 'class_name' => $class_name, + 'title' => $title, + 'description' => $description, + ]; + + $this->renderFile( + 'module/module.views.inc.twig', + $this->extensionManager->getModule($module)->getPath() . '/' . $module . '.views.inc', + $parameters + ); + + $this->renderFile( + 'module/src/Plugin/Views/field/field.php.twig', + $this->extensionManager->getPluginPath($module, 'views/field') . '/' . $class_name . '.php', + $parameters + ); + } +}