Skip to content
Advertisement

Laravel blade 3 levels quote issue [closed]

Anyone know what’s wrong with the following quote structure?

onclick="showMemberList('{{ $result['_id'] }}')"

I am getting the following error:

syntax error, unexpected '"_id"]); ?>"' (T_CONSTANT_ENCAPSED_STRING), expecting identifier (T_STRING)

I thought my structure is correct already where I escaped the ' wrapping _id

Advertisement

Answer

It does not need to escape the _id quotes:

onclick="showMemberList('{{ $result['_id'] }}')"
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement