我傳遞一個變量與窗體視圖來獲取數據庫中的值形式。如何獲取laravel中窗體值域的數組數據?
public function getGeneralSettings()
{
$generalsetting = DB::table('generalsettings')
->where('id', '=', 1)
->get();
return view('backend.generalsettings.add-general')->with('general', $generalsetting);
}
什麼,我得到的是:
[{"id":1,"sitename":"eqwe","tagline":"ewqewq","logo":"1492084338.jpg","firstemail":"qwewq","secondemail":"ewqewq","firstphone":21321,"secondphone":32132,"address":"
dassa<\/p>","facebook":"dqw","twitter":"q","linkedin":"q","google":"q","youtube":"q","instagram":null,"reddit":"q","rss":"q","created_at":"2017-04-13 11:52:18","updated_at":"2017-04-13 11:52:18"}]
我瓦納在我的表單字段顯示這些值。
<div class="form-group">
<label for="sitename">Site Name</label>
<input type="text" id="sitename" name="sitename" class="form-control" value="" placeholder="Site name">
</div>
<div class="form-group">
<label for="tagline">Tagline</label>
<input type="text" id="tagline" name="tagline" placeholder="Tagline" value="" class="form-control">
</div>
如何在特定的值字段中調用它們。請幫助
謝謝你..我嘗試了值=「{{$ general-> sitename}}」之前.. bt我得到錯誤。主要問題是第一個();謝謝! :) –