Store current record ID as a variable

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
rpierce
Veteran Member
Posts: 255
Joined: 2018-11-26 13:55
Location: Washington State

Store current record ID as a variable

Post by rpierce » 2022-11-01 17:57

Hello,

I have created a dashboard to illustrate information from my database. I want to limit the dashboard to show records from the currently selected "Project". If a user is viewing AppGini records from a project I would like to have a button that opens the dashboard filtered to the currently selected project. I can see the "Project Id" ** localhost/diary/hooks/dash.php?project_id=51** in the browser address bar, but how can I get that into a variable for use in a query?

Thank you for any help,

Ray

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Store current record ID as a variable

Post by jsetzer » 2022-11-01 18:16

Include lib.php, then:

Code: Select all

$pid = (string)Request::val('project_id', '');
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

Post Reply