我想在视图视图中播放一个数组
控制器代码是
$service = geoserver_url;
$data = "<workspace><name>testnew</name></workspace>";
$url = $service . "rest/workspaces/workspacename";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$passwordStr = username:password
curl_setopt($ch, CURLOPT_USERPWD, $passwordStr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-type: application/xml"););
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$result = curl_exec($ch);
$info = curl_getinfo($ch);
Any kind of help appreciated.
我无法在视图中使用每个
检索它$data['medications'] = array('medicine' => 'meds',
'dosage' => 'dosage');
return view('medications.index', $data);
答案 0 :(得分:0)
只需使用$data
@foreach($medications as $data)
{{$data}}
@endforeach
答案 1 :(得分:0)
你必须使用它。
@foreach($medications as $data)
{{$data}}
@endforeach
因为这里的$药物是你制作的数组 $ data ['medications'] = array('medicine'=&gt;'meds', '剂量'=&gt; '剂量');