Ronald Ngoda

How To Use Sweet Alert Notification On Appgini Events

Published 2021-02-085 min read4 comments
image

Do you need to have an above Alert when you insert records or update records in Appgini instead of the default Appgini alert? Then I got you covered.

STEP ONE

Paste the following code above the tag of your header.php file

STEP TWO

 Go to your hooks folder and create a file named replace-appgini-functions.php paste in the following code:

STEP THREE

In your hooks folder create a file named mod.showNotifications.php and paste in the following code:

We’ve now created 2 files inside the hooks folder: replace-appgini-functions.php and mod.showNotifications.php. Whenever you want to regenerate your AppGini application, all you need to do is to call/hit replace-appgini-functions.php once to apply your modified code. As a safety measure, the file to be modified will be backed up first. Also, our code above would check if modifications were already applied, and if so they won’t be re-applied. So, it’s actually safe to call this file multiple times. Only the first time will apply modifications, and others would do nothing and just notify you that changes were already applied.

Assuming our app is hosted on example.com/staff-db, to apply the modified showNotifications() function, we should visit this URL from a browser: example.com/staff-db/hooks/replace-appgini-functions.php

For more info on how to replace or overwrite appgini functions reffer HERE

Promo Section

You can use this section to promote your side projects etc.

image