I'm trying to create a new plugin for my website in Craft CMS 3, just to do some really basic stuff, like parsing an XML file from an external site.
I created it using the plugin creator at https://pluginfactory.io/ as per the craft docs. I have only included the controller and variable components.
I've added it in to my composer.json file, run the composer require command and it has successfully been added to the plugins list with my craft install. However, when I go try and install it from the plugins page, I get this error: "The use statement with non-compound name 'Craft' has no effect in /var/www/html/[websitename]/plugins/[websitename]/src/[websitename].php at line 15"
This is what the code that has been generated looks like (website name redacted):
11 namespace \[websitename]; 12 13 use \[websitename]\variables\[websitename]Variable; 14 15 use Craft; 16 use craft\base\Plugin; 17 use craft\services\Plugins; 18 use craft\events\PluginEvent; 19 use craft\web\UrlManager; 20 use craft\web\twig\variables\CraftVariable; 21 use craft\events\RegisterUrlRulesEvent; 22 23 use yii\base\Event;
Does anyone have any idea what is happening here? I've tried reading the plugin docs but I can't see what is going wrong. I assume the plugin creator is generating files correctly, I've used it several times for Craft 2, but this is my first attempt at a Craft 3 plugin.