public function generateSlots($dir, $themeName, $templateName, array $slots)
    {
        $themeBasename = str_replace('Bundle', '', $themeName);
        $extensionAlias = Container::underscore($themeBasename);

        $parameters = array(
            'theme_name' => $extensionAlias,
            'template_name' => $templateName,
            "slots" => $slots,
        );

        $slotFile = $templateName . '.xml';
        $this->setSkeletonDirs($this->themeSkeletonDir);
        $this->renderFile('slots.xml', $dir . '/' . $slotFile, $parameters);

        $message = '';
        foreach ($slots as $slotName => $slot) {
            if (array_key_exists('errors', $slot)) {
                foreach ($slot['errors'] as $error) {
                    $message .= sprintf('<error>The argument %s assigned to the %s slot is not recognized</error>', $error, $slotName);
                }
            }
        }
        $message .= sprintf('The template\'s slots <info>%s</info> has been generated into <info>%s</info>', $slotFile, $dir);

        return $message;
    }