I'm aware of some posts already dealing with the same topic.
Following are the links:
Javascript Template Engine Use with jQuery
I'm trying to incorporate a php explode function into a javascript template. The plugin is jQuery-File-Upload from blueimp @ https://github.com/blueimp/jQuery-File-Upload/downloads i downloaded off GitHub.
Following is part of my code i'm trying to execute and make it work.
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr>
<td>
<?php echo "{%=file.name%}"; ?> //{%file.name%} contains a string seperated by underscores
<?php $file_name_long = '{%=file.name%}'; ?>
<?php $file_name = explode ('_' , $file_name_long); ?>
<?php print_r($file_name); ?>
</td>
</tr>
...
...
I'm able to make $file_name print out as an array but I'm not able to get it seperated by the underscore within my file.name. the printed array contains the whole string as per file.name.
I'm not sure if this is even possible. I've been trying all day. If this is not do-able or logically incorrect, do let me know so that i can stop trying to want to make this work. Thanks and appreciated.