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:Jump to 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...4 Replies
What's the "page key"? The key of the record?
$this->record->getKey()
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
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 tooAmazing thank you. I’ll give that a go
that worked like a charm. thank you