Create a Basic Plugin

hey there,
i’m trying to create a basic plugin.
but now in the basics of creation i get a fatal error.

Uncaught RuntimeException: Plugin 'istool' class not found!

/user/plugins/istool/
./blueprints.yaml
./istool.php
./istool.yaml

istool.php:

<?php
namespace Grav\Plugin;
use Grav\Common\Plugin;

class istool extends Plugin
{
public function onPluginsInitialized()
{
}
public static function getSubscribedEvents()
{
return [
‘onPluginsInitialized’ => ['onPluginsInitialized', 0],
];
}
}
?>

blueprints.yaml and istool.yaml some basics from the documentation.

why do i get a fatal error?

greetings,
orlando

d’oh!
found it.

class istool extends Plugin

must be

class istoolPlugin extends Plugin

Easier way:

  1. Install devtools plugin: bin/gpm install devtools
  2. Create new plugin: bin/plugin devtools new-plugin
  3. Fill in the details when prompted
1 Like