我将数据传递给视图:
function changeTab(tab){
var newTab = "view"+tab;
var element_id = "t";
var newHTML = document.getElementById(newTab).innerHTML;
document.getElementById('first_View').innerHTML = newHTML;
accord_menu();
}
function accord_menu() {
var acc = document.getElementsByClassName("accordion_f");
var i;
for (i = 0; i < acc.length; i++) {
acc[i].onclick = function(){
this.classList.toggle("active");
this.nextElementSibling.classList.toggle("show");
}
}
}
这会在我们的网络服务器上使用nginx导致未定义的变量错误,但在我的本地测试环境中运行良好。
我正在运行Laravel 5.2,Nginx 1.2.1和PHP 5.5.33-1~docdeb + 7.1
错误:
下一个异常&#39; ErrorException&#39;消息&#39;未定义变量:civ_licenses(查看:/usr/share/nginx/www/husky/resources/views/players/player.blade.php)'在/usr/share/nginx/www/husky/storage/framework/views/2eaefa36b185667c6ab8fa106c6757a738f3e48b.php:157
完整Stacktrace:http://pastebin.com/raw/pndXegtE
$player_data = DB::connection('a3db')->select('SELECT * FROM players WHERE playerid = ?', [$pid]);
$skills = decodelicense($player_data['0']->skill);
$civ_licenses = decodelicense($player_data['0']->civ_licenses);
$med_licenses = decodelicense($player_data['0']->med_licenses);
$cop_licenses = decodelicense($player_data['0']->cop_licenses);
$adac_licenses = decodelicense($player_data['0']->adac_licenses);
return view('players.ajax', ['data' => $player_data,'pid' => $pid,'civ_licenses' => $civ_licenses,'cop_licenses' => $cop_licenses,'adac_licenses' => $adac_licenses,'med_licenses' => $med_licenses,'skills' => $skills]);