我正在尝试创建一个图像路线,这意味着,使用图像作为路线。这是我正在尝试创建的更新链接,但它不断发出此错误:
FatalErrorException in fdda73edfe1d1362826e9383e141e71a line 52:
syntax error, unexpected 'height' (T_STRING)
也许css的格式是它不理解的。 这是代码:
{!! Html::linkRoute('updateUserContact', '<img style='height: 100%; width: 100%; object-fit: contain' src="' . asset('images/add.png') . '"/>', contacts->id) !!}
答案 0 :(得分:1)
试试这个:
public class SessionLogin {
SharedPreferences pref;
SharedPreferences.Editor editor;
Context context;
int PRIVATE_MODE = 0;
private static final String PREF_NAME = "MyAppPref";
private static final String IS_LOGIN = "IsLoggedIn";
public static final String KEY_NAME = "name";
public static final String KEY_EMAIL = "email";
public SessionLogin(Context context){
this.context = context;
pref = this.context.getSharedPreferences(PREF_NAME, PRIVATE_MODE);
editor = pref.edit();
}
public void createLoginSession(String name, String email){
editor.putBoolean(IS_LOGIN, true);
editor.putString(KEY_NAME, name);
editor.putString(KEY_EMAIL, email);
editor.commit();
}
public void checkLogin(){
if(!this.isLoggedIn()){
Intent i = new Intent(context, ActivityHome.class);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
}
}
public HashMap<String, String> getUserDetails(){
HashMap<String, String> user = new HashMap<String, String>();
user.put(KEY_NAME, pref.getString(KEY_NAME, null));
user.put(KEY_EMAIL, pref.getString(KEY_EMAIL, null));
return user;
}
public void logoutUser(){
editor.clear();
editor.commit();
Intent i = new Intent(context, ActivitySignIn.class);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
}
public boolean isLoggedIn(){
return pref.getBoolean(IS_LOGIN, false);
}
}
您使用了单引号,它提前结束了字符串/参数