Hi, I’ve done a test because I want to understand how to use library (include and exec).
So, on this page https://www.campaniaturismo.org/admin/admin-vicinanze-comuni-add-new.php?id=8
I want to show the name of a city filtered by a query string.
On this page you can see:
Aggiungi località nelle vicinanze di Avellino
Avellino is taken from a database filtered by the query string id=8
I’ve done it in the classical way, an action file with $_GET variable in the input section of the action file.
I try the same thing using library and an exec API.
Unfortunately it doesn’t run.
You should see “Avellino” under the previous row but you don’t.
Does anyone know what’s wrong?
Thank you
PS. per gli utenti italiani c’è un server discord dedicato che tutti possono utilizzare per postare le proprie domande e ricevere aiuto dalla comunità degli utenti.
Which version of wappler and server language are you using ?
I couldn’t get include to work yetand opened a bug report Server Include values not being passed
I did see it just after I posted. I did a test and it seems like the library actions do not work when inside subfolder. Try not using subfolder, then its working for me.
Using library item is like calling a function, you have to give it its input variables.
So you need to define our $_GET in your main action and also in your library action.
Then when you exec the library action, give as its input the $_GET input from the main action. So they value is passed.
Other way is just to include the library action then you don’t need to bind any parameters as it is just inline included. You still have to define the same $_GET parameter in both before usage.