protected function renderSlots(Page $page, array $slots, array $options = array())
    {
        $renderedSlots = array();
        $slots = $this->dispatchSlotsEvent(RenderEvents::SLOTS_RENDERING, $page, $slots);
        foreach ($slots as $slotName => $slot) {
            if (is_string($slot)) {
                $renderedSlots[$slotName] = $slot;
                continue;
            }

            if (!$slot instanceof Slot) {
                continue;
            }

            $blocks = $slot->getEntitiesInUse();
            $renderedSlots[$slotName] = $this->templating->render(
                'RedKiteCms/Resources/views/Slot/slot.html.twig',
                array(
                    'options' => $options,
                    'slotname' => $slotName,
                    'data' => rawurlencode("[" . implode(",", $blocks)) . "]",
                    'next' => $slot->getNext(),
                )
            );
        }

        return $slots = $this->dispatchSlotsEvent(RenderEvents::SLOTS_RENDERED, $page, $renderedSlots);
    }