public function render()
    {
        $codeFormat = '$.toast(%s, %s);';
        $items = array();
        $js = '';

        foreach ($this->container as $toast) {
            $items[] = sprintf($codeFormat, Json::encode($toast->getMessage()), Json::encode($toast->getOptions()));
        }

        if (!empty($items)) {
            $js = '<script type="text/javascript">//<![CDATA['."\n"
                . 'jQuery(function($) {' . "\n"
                . implode("\n", $items) . "\n"
                . "});\n" . '//]]></script>';
        }

        return $js;
    }