Soy muy nuevo en aframe y me gustaría pasar una variable php a mi evento de clic. Sé que en javascript 2D solo necesito escribir onclick=myFunction('{{ $myVariable }}') pero en un marco todavía tengo que ver un ejemplo como ese.
aquí está mi código html:
@foreach($files as $file) <a-entity id="gif-display1"> <a-entity position="2 0 -7" mixin="edit" id="edit_{{$file->id}}"></a-entity> <a-entity position="-2 0 -7" mixin="delete" id=="delete_{{$file->id}}"></a-entity> </a-entity foo> @endforeachAquí está mi javascript
AFRAME.registerComponent('foo' { init:function(){ // what do I put here? I need to get the id of the entity clicked })¿Alguien sabe cómo hacer eso? Por favor ayuda. Gracias