public function loadConfiguration()
    {
        // Load extension configuration
        $config = $this->getConfig();

        if(!isset($config['path']))
        {
            throw new ServiceCreationException('Missing required path parameter in PaletteExtension configuration');
        }

        if(!isset($config['url']))
        {
            throw new ServiceCreationException('Missing required url parameter in PaletteExtension configuration');
        }

        // Register extension services
        $builder = $this->getContainerBuilder();

        // Register palette service
        $builder->addDefinition($this->prefix('service'))
                ->setClass('NettePalette\Palette', array(

                    $config['path'],
                    $config['url'],
                    $config['basepath'],
                    empty($config['fallbackImage']) ? NULL : $config['fallbackImage'],
                    empty($config['template']) ? NULL : $config['template'],
                    empty($config['websiteUrl']) ? NULL : $config['websiteUrl'],
                    empty($config['pictureLoader']) ? NULL : $config['pictureLoader'],
                ))
                ->addSetup('setHandleExceptions', [

                    !isset($config['handleException']) ? TRUE : $config['handleException'],
                ]);

        // Register latte filter service
        $builder->addDefinition($this->prefix('filter'))
                ->setClass('NettePalette\LatteFilter', [$this->prefix('@service')]);

        // Register latte filter
        $this->getLatteService()
             ->addSetup('addFilter', ['palette', $this->prefix('@filter')]);

        // Register extension presenter
        $builder->getDefinition('nette.presenterFactory')
                ->addSetup('setMapping', [['Palette' => 'NettePalette\*Presenter']]);
    }
public function loadConfiguration()
    {
        // Load extension configuration
        $config = $this->getConfig();

        if(!isset($config['path']))
        {
            throw new ServiceCreationException('Missing required path parameter in PaletteExtension configuration');
        }

        if(!isset($config['url']))
        {
            throw new ServiceCreationException('Missing required url parameter in PaletteExtension configuration');
        }

        // Register extension services
        $builder = $this->getContainerBuilder();

        // Register palette service
        $builder->addDefinition($this->prefix('service'))
                ->setClass('NettePalette\Palette', array(

                    $config['path'],
                    $config['url'],
                    $config['basepath'],
                    empty($config['fallbackImage']) ? NULL : $config['fallbackImage'],
                    empty($config['template']) ? NULL : $config['template'],
                    empty($config['websiteUrl']) ? NULL : $config['websiteUrl'],
                    empty($config['pictureLoader']) ? NULL : $config['pictureLoader'],
                ))
                ->addSetup('setHandleExceptions', [

                    !isset($config['handleException']) ? TRUE : $config['handleException'],
                ]);

        // Register latte filter service
        $builder->addDefinition($this->prefix('filter'))
                ->setClass('NettePalette\LatteFilter', [$this->prefix('@service')]);

        // Register latte filter
        $this->getLatteService()
             ->addSetup('addFilter', ['palette', $this->prefix('@filter')]);

        // Register extension presenter
        $builder->getDefinition('nette.presenterFactory')
                ->addSetup('setMapping', [['Palette' => 'NettePalette\*Presenter']]);
    }
public function loadConfiguration ( ) { // Load extension configuration $ config = $ this -> getConfig ( ) ; if ( ! isset ( $ config [ 'path' ] ) ) { throw new ServiceCreationException ( 'Missing required path parameter in PaletteExtension configuration' ) ; } if ( ! isset ( $ config [ 'url' ] ) ) { throw new ServiceCreationException ( 'Missing required url parameter in PaletteExtension configuration' ) ; } // Register extension services $ builder = $ this -> getContainerBuilder ( ) ; // Register palette service $ builder -> addDefinition ( $ this -> prefix ( 'service' ) ) -> setClass ( 'NettePalette\Palette' , array ( $ config [ 'path' ] , $ config [ 'url' ] , $ config [ 'basepath' ] , empty ( $ config [ 'fallbackImage' ] ) ? NULL : $ config [ 'fallbackImage' ] , empty ( $ config [ 'template' ] ) ? NULL : $ config [ 'template' ] , empty ( $ config [ 'websiteUrl' ] ) ? NULL : $ config [ 'websiteUrl' ] , empty ( $ config [ 'pictureLoader' ] ) ? NULL : $ config [ 'pictureLoader' ] , ) ) -> addSetup ( 'setHandleExceptions' , [ ! isset ( $ config [ 'handleException' ] ) ? TRUE : $ config [ 'handleException' ] , ] ) ; // Register latte filter service $ builder -> addDefinition ( $ this -> prefix ( 'filter' ) ) -> setClass ( 'NettePalette\LatteFilter' , [ $ this -> prefix ( '@service' ) ] ) ; // Register latte filter $ this -> getLatteService ( ) -> addSetup ( 'addFilter' , [ 'palette' , $ this -> prefix ( '@filter' ) ] ) ; // Register extension presenter $ builder -> getDefinition ( 'nette.presenterFactory' ) -> addSetup ( 'setMapping' , [ [ 'Palette' => 'NettePalette\*Presenter' ] ] ) ; }
Processes configuration data.
@return void
@throws ServiceCreationException
Processes configuration data .