Hi,
I'm trying to create a new template in Magento 2 but when including the registration.php file, it throws the error "Parse error: syntax error, unexpected ':' in C:\xampp\htdocs\app\design\frontend\compname\newtheme\registration.php on line 17"
The code in the file is:
<?php
C:\xampp\htdocs\vendor\magento\framework\Component\ComponentRegistrar::register(
C:\xampp\htdocs\vendor\magento\framework\Component\ComponentRegistrar::THEME,
'frontend/compname/newtheme',
__DIR__);
?>
Can anyone please advise?
Many thanks
Solved! Go to Solution.
Hi,
Switching on the error messages showed that I was missing the preview.jpg. (To enable the error go to C:\xampp\htdocs\pub\errors and rename local.xml.sample to local.xml.)
Many thanks
Hi @ndalli,
Your code should be:
\Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::THEME, 'frontend/compname/newtheme', __DIR__ );
The C:\xampp\htdocs... part is wrong on your example.
Hi,
Many thanks for your answer. I did the suggested changes and also executed the command "php bin/magento setup:static-content:deploy". However I'm still getting the following error when trying to load the Admin Dashboard.
There has been an error processing your request
Exception printing is disabled by default for security reasons.
Error log record number: 13859653
Thanks