3

I'm new to Magento 2.

Fatal error: Class 'Mage' not found in \vendor\magento\module-theme\view\base\templates\root.phtml on line 23

Can anybody tell me how to solve this?

Amit Bera
  • 77,456
  • 20
  • 123
  • 237
Jackson
  • 9,909
  • 29
  • 128
  • 217

3 Answers3

3

It looks like the theme you installed is not compatible with Magento 2.
Aparently it has a Mage::...() call in one of the files.

Marius
  • 197,939
  • 53
  • 422
  • 830
3

Mage is deprecated in Magento2.

Magento2, not using factory Patten types like Mage::getModel ,Mage::getsingleton() etc

It now uses the class nameSpace concept

To learn more about how to use ObjectManager in Magento 2, checkout these links:

joeybab3
  • 378
  • 1
  • 17
Amit Bera
  • 77,456
  • 20
  • 123
  • 237
-1

in magento 2 call the model any where

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$model = $objectManager->create('\Namespace\Modulename\Model\Modulename');
Hafiz Arslan
  • 802
  • 1
  • 12
  • 37