Hi all.Need some help with including my own class into custom plugin.When I load the page, I have an error “Class ‘Grav\Plugin\MCAPI’ not found” .Please help how to fix it.Thanks before
<?
namespace Grav\Plugin;
use Grav\Common\Plugin;
use Grav\Common\Twig\Twig;
use RocketTheme\Toolbox\Event\Event;
class ExamplePlugin extends Plugin
{
public static function getSubscribedEvents()
{
return [
‘onPluginsInitialized’ => ['onPluginsInitialized', 0],
‘onTwigExtensions’ => ['onTwigExtensions', 0],
‘onFormProcessed’ => ['onFormProcessed', 0]
];
}
public function onTwigExtensions()
{
requireonce(DIR_ . ‘/twig/ExampleTwigExtension.php’);
$this->grav['twig']->twig->addExtension(new ExampleTwigExtension());
}
public function onPluginsInitialized()
{
if ($this->config->get('plugins.example.enabled')) {
$this->enable([
‘onTwigSiteVariables’ => ['onTwigSiteVariables', 0]
]);
}
}
public function onTwigSiteVariables()
{
requireonce DIR_ . ‘/classes/MCAPI.class.php’;
$twig = $this->grav['twig'];
//need something write here.
}
}
?>