을 얻을 :laravel의 file_get_contents 내가 경로가 응답
http://localhost:8000/playlist/raw/1
다 괜찮 및 페이지가로드 나에게보기를 표시합니다 :
Route::group(array('prefix' => 'playlist'), function()
{
Route::get('raw/{id}', array('as'=>'rawPlaylist', 'uses'=>'[email protected]'));
});
나는 URL을 열
. 컨트롤러에서 나는 URL을 얻을 :$url = URL::route('rawPlaylist', 1);
문제 :
$html = file_get_contents($url);
에코 $의 URL은 다음과 같습니다 내가보기를 읽고 변수에 전체보기를 저장하려면 http://localhost:8000/playlist/raw/1이게 맞습니다.
하지만 작동하지 않습니다. 나는 응답을 얻지 않으며 PHP 장인은 휴식을 제공합니다. 왜? 여기서 뭐가 잘못 됐니?
url echo $ url을 참조하십시오. ? –
echo $ url은'http : // localhost : 8000/playlist/raw/1'입니다. – goldlife
오른쪽 : URL http : // localhost : 8000/de/playlist/raw/1 –