src/Kunstmaan/GeneratorBundle/Generator/DefaultSiteGenerator.php
public function generateMenuAdaptors(array $parameters)
    {
        if ($this->demosite) {
            $relPath = '/Helper/Menu/';
            $sourceDir = $this->skeletonDir.$relPath;
            $targetDir = $this->bundle->getPath().$relPath;

            $this->renderSingleFile($sourceDir, $targetDir, 'AdminMenuAdaptor.php', $parameters);

            if ($this->isSymfony4()) {
                return;
            }

            $file = $this->bundle->getPath().'/Resources/config/services.yml';
            if (!is_file($file)) {
                $ymlData = 'services:';
            } else {
                $ymlData = '';
            }
            $ymlData .= "\n\n    ".strtolower($this->bundle->getName()).'.admin_menu_adaptor:';
            $ymlData .= "\n        class: ".$this->bundle->getNamespace()."\Helper\Menu\AdminMenuAdaptor";
            $ymlData .= "\n        tags:";
            $ymlData .= "\n            -  { name: 'kunstmaan_admin.menu.adaptor' }\n";
            file_put_contents($file, $ymlData, FILE_APPEND);

            $this->assistant->writeLine('Generating menu adaptors : <info>OK</info>');
        }
    }
public function generateMenuAdaptors(array $parameters)
    {
        if ($this->demosite) {
            $relPath = '/Helper/Menu/';
            $sourceDir = $this->skeletonDir.$relPath;
            $targetDir = $this->bundle->getPath().$relPath;

            $this->renderSingleFile($sourceDir, $targetDir, 'AdminMenuAdaptor.php', $parameters);

            if ($this->isSymfony4()) {
                return;
            }

            $file = $this->bundle->getPath().'/Resources/config/services.yml';
            if (!is_file($file)) {
                $ymlData = 'services:';
            } else {
                $ymlData = '';
            }
            $ymlData .= "\n\n    ".strtolower($this->bundle->getName()).'.admin_menu_adaptor:';
            $ymlData .= "\n        class: ".$this->bundle->getNamespace()."\Helper\Menu\AdminMenuAdaptor";
            $ymlData .= "\n        tags:";
            $ymlData .= "\n            -  { name: 'kunstmaan_admin.menu.adaptor' }\n";
            file_put_contents($file, $ymlData, FILE_APPEND);

            $this->assistant->writeLine('Generating menu adaptors : <info>OK</info>');
        }
    }
public function generateMenuAdaptors ( array $ parameters ) { if ( $ this -> demosite ) { $ relPath = '/Helper/Menu/' ; $ sourceDir = $ this -> skeletonDir . $ relPath ; $ targetDir = $ this -> bundle -> getPath ( ) . $ relPath ; $ this -> renderSingleFile ( $ sourceDir , $ targetDir , 'AdminMenuAdaptor.php' , $ parameters ) ; if ( $ this -> isSymfony4 ( ) ) { return ; } $ file = $ this -> bundle -> getPath ( ) . '/Resources/config/services.yml' ; if ( ! is_file ( $ file ) ) { $ ymlData = 'services:' ; } else { $ ymlData = '' ; } $ ymlData .= "\n\n    " . strtolower ( $ this -> bundle -> getName ( ) ) . '.admin_menu_adaptor:' ; $ ymlData .= "\n        class: " . $ this -> bundle -> getNamespace ( ) . "\Helper\Menu\AdminMenuAdaptor" ; $ ymlData .= "\n        tags:" ; $ ymlData .= "\n            -  { name: 'kunstmaan_admin.menu.adaptor' }\n" ; file_put_contents ( $ file , $ ymlData , FILE_APPEND ) ; $ this -> assistant -> writeLine ( 'Generating menu adaptors : <info>OK</info>' ) ; } }
Generate the menu adaptors classes.

@param array $parameters The template parameters
Generate the menu adaptors classes .