我需要将jquery ID值传递给codeigniter中的est_model-> get_img()函数并显示所有 在同一模态框中的内容,我尝试了自己的逻辑它不起作用,请帮助伙伴,提前谢谢 p>
这里是我的代码: \标记: mmodal a tag: p>
< a href =“#view_all_img_modal”data-toggle =“modal”data-est-id =“<?php echo $ row-> est_id;?> “>查看全部< / a>
code> pre>
我的jquery: p>
$('#view_all_images_modal') .on('show.bs.modal',function(e){
var est_id = $(e.relatedTarget).data('est-id');
$ .ajax({url:“admin / est_view .php?ID =“+ est_id,cache:false,success:function(result){
$(”#view_all_img_modal“)。html(result);
}});
});
code> pre>
模态框: p>
p>
< div class =”modal fade“id =”view_all_img_modal“tabindex =” - 1“role =”dialog“>
< div class =”row“>
<?php
$ id = $ _ GET ['ID'];
$ \ test_img = $ this-> \ test_model-> get_img($ id);
if($ est_img) :
foreach($ est_img as $ img):
$ ser_img =($ img-> img_name == NULL)?'no-image.png':$ img-> img_name;?&gt ;
< img src =“<?php echo base_url('../ public / images / rel_img /'.$ ser_img);?>”>
<?php endforeach;
ENDIF;?>
< / DIV>
< / DIV> 代码> PRE>
DIV>
DIV> \ r
div>