Laravel 5.1 PHP DOMDocument() class not found
Posted:
February 15, 2016
|
Categories:
News
, Magento Tutorial
, Wordpress
, vTiger CRM
, vTiger CRM Customer Portal
, Premium Plugin
, Git
, Laravel
, Mysql
, Ionic Framework
I'm using PHP's built-in DOMDocument() class to do some simple web-scrapping. However, it works on my 4.2 site, but not my 5.1 (both are on same installation of PHP).
Here's the error:
$list1 =new DOMDocument();
In Laravel 5.1 you must prefix the class name with the global namespace prefix '\'.
$list1 =new \DOMDocument();