Elgg\WidgetsService::getNameById PHP Method

getNameById() public method

Returns widget name based on id
Since: 2.2.0
public getNameById ( string $id, string $context = '', ElggEntity $container = null ) : string | boolean
$id string Widget identifier
$context string Context to check
$container ElggEntity Optional limit widget definitions to a container
return string | boolean
    public function getNameById($id, $context = '', \ElggEntity $container = null)
    {
        $types = $this->getTypes(['context' => $context, 'container' => $container]);
        if (isset($types[$id])) {
            return $types[$id]->name;
        }
        return false;
    }