public function getAlert($context, $key = null)
    {
        $session = $this->container->sessionHandler;

        // Get alert notices from page context, or failing that then session flash data
        $alert = (isset($context['alert'])) ? $context['alert'] : $session->getFlashData('alert');

        if ($key === null) {
            return $alert;
        }

        if (isset($alert[$key])) {
            if ($key === 'message' ) {
                return '<ul><li>' . implode('</li><li>', $alert['message']) . '</ul>';
            }

            return $alert[$key];
        }

        return null;
    }