I am new to custom plugin creation (per the Plugin Tutorial) and I have a problem. My custom GRAV plugin throws a fatal PHP error:
Error
Class 'Grav\Plugin\DOMDocument' not found
when I attempt to create (and use) the following:
<?php
namespace Grav\Plugin;
use Composer\Autoload\ClassLoader;
use Grav\Common\Plugin;
/* SEE: https://learn.getgrav.org/16/plugins/plugin-tutorial */
use Grav\Common\Page\Collection;
use Grav\Common\Uri;
use Grav\Common\Taxonomy;
/* use Grav\Common\Event; */
use Grav\Common\Page\Page;
use RocketTheme\Toolbox\Event\Event;
use RocketTheme\Toolbox\File\File;
use Thunder\Shortcode\Shortcode\ShortcodeInterface;
use ReflectionProperty;
class MyCustomPlugin extends Plugin
{
public function onFormProcessed(Event $event)
{
...
$dom = new DOMDocument();
...
}
}
even though ‘dom’ and ‘mbstring’ appear to be loaded extensions (apache 2.4.51, php 7.4.26, win10) as shown below:
-- PHP Loaded Extensions
With function get_loaded_extensions()
bcmath bz2 calendar com_dotnet Core ctype
curl date **dom** exif fileinfo filter
gd gettext gmp hash iconv imap
intl json ldap libxml **mbstring** mysqli
mysqlnd openssl pcre PDO pdo_mysql pdo_sqlite
Phar readline Reflection session SimpleXML soap
sockets SPL sqlite3 standard tokenizer xdebug
xml xmlreader xmlrpc xmlwriter xsl Zend OPcache
zip zlib
Is there a use ...
statement that would solve my (fatal) php problem/error?