Welcome Guest, Not a member yet? Register   Sign In
set_flashdata stays open
#5

(03-18-2021, 08:04 AM)php_rocs Wrote: @pedreitor,

Both of them are pretty easy to install and use.  Toastr seems to be the better fit for what you appear to want which is a message set with a timer.  Where as sweet alerts expects a response from the user.
Hi again.

Sorry for the insistence but I think that I do not import well any of the two libraries because I keep getting errors when using the methods that call the alerts in both options.
For example, to use toastr, what I do is to put in the header the following lines:

<link href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js"></script>



Then, i call the alert in the User controller (for example) for the logout method like this:

Code:
// Display an info toast with no title
toastr.info('Log in completed.')
 I followed the instructions described in the official page that you send me, but when I click the logout button, this happens:

An
uncaught exception was encountered
Type: error
Message: Undefined constant "toastr"

Something like that happens when I try to use SweetAlert, I do the same with the CDN and when I call the alert using the "swal" method, it says that the swal method is not defined.

Sorry if this is too basic, but i'm starting in CodeIgniter and I did't use too many stuff like this, and I don't know what to do.
Thanks in advance again.
Reply


Messages In This Thread
set_flashdata stays open - by pedreitor - 03-16-2021, 04:16 AM
RE: set_flashdata stays open - by php_rocs - 03-16-2021, 06:55 AM
RE: set_flashdata stays open - by pedreitor - 03-17-2021, 09:05 AM
RE: set_flashdata stays open - by php_rocs - 03-18-2021, 08:04 AM
RE: set_flashdata stays open - by pedreitor - 03-18-2021, 12:03 PM
RE: set_flashdata stays open - by php_rocs - 03-18-2021, 02:27 PM
RE: set_flashdata stays open - by pedreitor - 03-22-2021, 12:12 PM
RE: set_flashdata stays open - by pedreitor - 03-22-2021, 02:20 PM
RE: set_flashdata stays open - by InsiteFX - 03-22-2021, 08:45 PM
RE: set_flashdata stays open - by pedreitor - 03-23-2021, 03:24 AM
RE: set_flashdata stays open - by php_rocs - 03-23-2021, 06:29 AM
RE: set_flashdata stays open - by demyr - 03-23-2021, 02:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB