How to access Page key

Hi all Just a quick one hopefully. I have need to dynamically access to page key eg Create Edit List. I need to only allow a check on the default option for a select based off whether the $_GET parameter exists. But only want to do so on the Create form. Is there a quick one to check this ? Thanks all
Solution:
Or whether the from being presented is Create or Edit
fn ($context) => $context == 'edit' I think there is also $operation. I think that includes Actions too...
Jump to solution
4 Replies
Dennis Koch
Dennis Koch5mo ago
What's the "page key"? The key of the record? $this->record->getKey()
David | Fortune Validator
I mean the pages defined here: public static function getPages(): array { return [ // ... 'sort' => Pages\SortUsers::route('/sort'), ]; } Is there a way to get the active page ? Or whether the from being presented is Create or Edit. Either way would hopefully get what I need. Hope that made sense.
Solution
Dennis Koch
Dennis Koch5mo ago
Or whether the from being presented is Create or Edit
fn ($context) => $context == 'edit' I think there is also $operation. I think that includes Actions too
David | Fortune Validator
Amazing thank you. I’ll give that a go that worked like a charm. thank you
Want results from more Discord servers?
Add your server