0
我有這樣的路線:路由與Laravel公共文件夾中的文件4
Route::any("/operations/xml", array("as"=>"operations.xml", "uses"=>"[email protected]"));
我的控制器產生的公共文件夾中保存一個xml:
OperationsController.php:
public function generateXml(){
$doc = new DomDocument("1.0", "UTF-8");
$doc->formatOutput = true;
//I add my stuff inside de xml from the database here...
$doc->save("xml/test.xml");
}
但我需要的是,當我導航到路線http://example.com/operations/xml我將能夠下載xml。我怎樣才能做到這一點?
完美,謝謝! – 2014-10-07 15:36:46