I have a query. I’ve been given the task of adding a new function to our web application. It was built on PHP by someone else, so it's proving quite challenging for me to debug as I am not familiar with this technology.
I’m attempting to incorporate this feature without creating additional presenters or classes, even though I understand that’s not the recommended approach.
Here lies my issue. I’m including a .latte file (PHP) located at:
root/app/presenters/templates/obligation/function.latte
<!-- The Modal -->
<div id="myModal" class="modal">
<!-- Modal content -->
<div class="modal-content">
<span class="close">×</span>
{include 'data.latte'}
<div id="firma_pass"></div>
</div>
</div>
and then using AJAX in a .javascript file, which I want to call data.latte from:
root/web/js/handler.js
var xmlhttp = new XMLHttpRequest();
xmlhttp.open('GET', "data.latte?toSearch=" + something, true);
xmlhttp.send();
However, I’m facing difficulty in making it function properly. I am unable to use GET request on a .latte file within the templates folder or import a .latte file directly from the web directory. Transferring the .js file to the templates folder is also proving unproductive.
So, my question is: is it feasible to achieve this setup, or do I need to explore other implementation methods?
Appreciate any insights provided.