在codeigniter中通过toastr传递字符串值

时间:2017-10-25 09:37:43

标签: php string codeigniter toastr

这里我想通过tostr显示validation_error消息,以便我像这样编写我的代码

 <script type="text/javascript">
 toastr.options = {
 "closeButton": true,
 //"allowHtml": true,
 "debug": false,
 "newestOnTop": false,
 "progressBar": false,
 "positionClass": "toast-bottom-right",
 "preventDuplicates": false,
 "onclick": null,
 "showDuration": "300",
 "hideDuration": "1000",
 "timeOut": "5000",
 "extendedTimeOut": "1000",
 "showEasing": "swing",
 "hideEasing": "linear",
 "showMethod": "fadeIn",
 "hideMethod": "fadeOut"
  }
 </script>


 <?php
 if (!empty($message)) {?>
      <script>  

        toastr.error('<?php echo $message;?>', 'Inconceivable!', {timeOut: 5000})
      </script>
 <?php }?>

我的$ message包含这样的字符串

'<p>The New Password field does not match the Confirm New Password field.</p>'

请帮我解决。

0 个答案:

没有答案