Access Parameters of the Active Menu Item
Retrieves the active MenuItem via $app->getMenu()->getActive() and reads any parameter with getParams().
<?php
declare(strict_types=1);
use Joomla\CMS\Factory;
$active = Factory::getApplication()->getMenu()->getActive();
// ...