我在resources/views/layouts/main.blade.php
有一个主模板。它看起来像这样:
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
@yield('test')
</body>
</html>
我正在resources/views/auth/login.blade.php
点击登录页面:
@extends('layouts.main)
@section('test')
test
@endsection
这就像它可以得到的一样简单 - 但我看到了通常无意义的Laravel错误信息:
FatalErrorException in 180d7ceab6e7cde074091b437eb5346a line 6:
syntax error, unexpected '__data' (T_STRING)
我错过了什么?
答案 0 :(得分:1)
您错过了此行中的引文:private void showDialog(String message) {
try
{
Looper.prepare();
Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
try {
Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
Ringtone r = RingtoneManager.getRingtone(context.getApplicationContext(), notification);
r.play();
} catch (Exception e) {
e.printStackTrace();
UserPrefs.setLogerForException(Log.getStackTraceString(e).toString(),
GlobalContext.Myglobalcontext,ApiConstants.Excption_Log_Message);
}
CustomAlert alertDialog = new CustomAlert();
alertDialog.setTitle(context.getResources().getString(R.string.notification_tite));
alertDialog.setMessage(msg.obj.toString());
alertDialog.setAlertId(Events.MORE_INFO);
alertDialog.setTextGravity(Gravity.LEFT);
ReplicaPrefs.showAlert(alertDialog);
}
};
Message msgObj = handler.obtainMessage();
msgObj.obj = message ;
handler.handleMessage(msgObj);
}
catch(Exception ex)
{
UserPrefs.setLogerForException(Log.getStackTraceString(ex).toString(),
GlobalContext.Myglobalcontext,ApiConstants.Excption_Log_Message);
}
}
答案 1 :(得分:0)
您的陈述@extends('layouts.main)
缺少单引号“'”