<?php
/**
 * Created by PhpStorm.
 * User: Michal
 * Date: 8.1.14
 * Time: 19:02
 */

namespace AnnotateCms\Themes\DI;


use AnnotateCms\Framework\DI\CompilerExtension;
use AnnotateCms\Themes\Loaders\ThemesLoader;
use Kdyby\Events\DI\EventsExtension;

class ThemesExtension extends CompilerExtension
{


    function getServices()
    {
        $config = $this->getConfig();
        return [
            "themeLoader" => [
                "class" => ThemesLoader::classname,
                "tags" => [EventsExtension::SUBSCRIBER_TAG],
                "setup" => [
                    "setFrontendTheme" => ["name" => $config["frontend"]],
                    "setBackendTheme" => ["name" => $config["backend"]],
                ],
            ],
        ];
    }


    function getFactories()
    {
        // TODO: Implement getFactories() method.
    }


    function  getDefaults()
    {
        return [
            "frontend" => "Sandbox",
            "backend" => "Flatty",
        ];
    }
}

<?php
/**
 * Created by PhpStorm.
 * User: Michal
 * Date: 8.1.14
 * Time: 19:02
 */

namespace AnnotateCms\Themes\DI;


use AnnotateCms\Themes\Loaders\ThemesLoader;
use Kdyby\Events\DI\EventsExtension;
use Nette\DI\CompilerExtension;

class ThemesExtension extends CompilerExtension
{
    public function loadConfiguration()
    {
        $configuration = $this->getConfig($this->getDefaults());

        $this->getContainerBuilder()->addDefinition($this->prefix('themeLoader'))
            ->setClass(ThemesLoader::classname)
            ->addTag(EventsExtension::SUBSCRIBER_TAG)
            ->addSetup('setFrontendTheme', ['name' => $configuration['frontend']])
            ->addSetup('setBackendTheme', ['name' => $configuration['backend']]);
    }


    function  getDefaults()
    {
        return [
            'frontend' => '',
            'backend' => '',
        ];
    }
}

Remove custom compiler extension class
Remove custom compiler extension class
