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 win10权限管理,限制普通用户使用删除功能
  • ¥15 minnio内存占用过大,内存没被回收(Windows环境)
  • ¥65 抖音咸鱼付款链接转码支付宝
  • ¥15 ubuntu22.04上安装ursim-3.15.8.106339遇到的问题
  • ¥15 求螺旋焊缝的图像处理
  • ¥15 blast算法(相关搜索:数据库)
  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?
  • ¥15 网络通信安全解决方案
  • ¥50 yalmip+Gurobi
  • ¥20 win10修改放大文本以及缩放与布局后蓝屏无法正常进入桌面