dongmufen8105 2014-10-31 07:30
浏览 27
已采纳

如何使用CHtml :: linkBut​​ton在yii中创建确认链接

I am using Yii and want to create a link to delete the item from the database but when i am using the CHtml::linkButton to create url with confirm option its not creating the url just adding # with the current url , I am using the following code

CHtml::linkButton(UserModule::t('Delete User'),array('submit'=>array('delete','id'=>$model->id),'confirm'=>UserModule::t('Are you sure to delete this item?')))

but if i use this without confirm button its working

  • 写回答

1条回答 默认 最新

  • dongyou2305 2014-11-01 05:06
    关注

    i have found the sol by using this.

    echo CHtml::link(UserModule::t('Delete User'),array('delete','id'=>$model->id),array('confirm' => 'Are you sure to delete this item?'));
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记