Php Slim框架应用程序->;提供
我有两条路线,get方法用于可视化所有数据,post方法用于插入数据。在get方法中,使用app render(“查看名称”和数据),等等。在method post中,我将执行相同的操作,以便看到插入同一页面并弹出成功消息的结束。这两个方法有相同的url,问题是当我在post方法中呈现时,我查看了一半内容的页面,因为它无法识别get方法中的数据Php Slim框架应用程序->;提供,php,jquery,slim,Php,Jquery,Slim,我有两条路线,get方法用于可视化所有数据,post方法用于插入数据。在get方法中,使用app render(“查看名称”和数据),等等。在method post中,我将执行相同的操作,以便看到插入同一页面并弹出成功消息的结束。这两个方法有相同的url,问题是当我在post方法中呈现时,我查看了一半内容的页面,因为它无法识别get方法中的数据 $app->get('/url.html',function()use($app){ //code $app->rend
$app->get('/url.html',function()use($app){
//code
$app->render('url.html', array('name'=>$variable1,'user'=>$variable2)));
});
我想在插入后显示弹出窗口
$app->post('/url.html',function()use($app){
//code
$popup='$(function(){$( "#dialog-message" ).dialog({modal: true, buttons: {Ok: function() {$( this ).dialog( "close" );}}});});';
$app->render('url.html', array('popup'=>$popup) ));
});
视图中的“/url.html”
但不起作用
然后总结视图在post方法和弹出窗口中不起作用javascript控制台中是否有任何错误?根据您的观点,我认为它缺少jQuery,对吗?
<?php echo $popup ?>