Laravel 5.1 PHP DOMDocument() class not found

http://laravel.com/

http://kejyun.github.io/Laravel-4-Docum ... roduction/
回覆文章
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Laravel 5.1 PHP DOMDocument() class not found

文章 yehlu »

http://stackoverflow.com/questions/3157 ... -not-found

In Laravel 5.1 you must prefix the class name with the global namespace prefix '\'.

So your updated code:

代碼: 選擇全部

<?php

namespace App\Http\Controllers\III_Ranks;

use App\Http\Controllers\Controller;

use Illuminate\Http\Request;
use Illuminate\Http\Response;

class RanksController extends Controller 
{
    public function getRanks()
    {
        $list1 = new \DOMDocument();
        //etc...
    }
}
回覆文章

回到「laravel」