Builder/Admin/BaseBuilder.php
public function getJavascripts()
    {
        $self = $this;
        $parse_javascripts = function ($params, $javascripts) use ($self) {
            foreach ($params as $js) {

                if (is_string($js)) {
                    $js = array(
                        'path'  => $js,
                    );
                } elseif (isset($js['route'])) {
                    $js = array(
                        'path'  => $self->getGenerator()
                                        ->getContainer()
                                        ->get('router')
                                        ->generate($js['route'], $js['routeparams'])
                    );
                }

                $javascripts[] = $js;
            }

            return $javascripts;
        };

        // From config.yml
        $javascripts = $parse_javascripts(
            $this->getGenerator()->getContainer()
                 ->getParameter('admingenerator.javascripts', array()), array()
        );

        // From generator.yml
        $javascripts = $parse_javascripts(
            $this->getVariable('javascripts', array()), $javascripts
        );

        return $javascripts;
    }
public function getJavascripts()
    {
        $self = $this;
        $parse_javascripts = function ($params, $javascripts) use ($self) {
            foreach ($params as $js) {

                if (is_string($js)) {
                    $js = array(
                        'path'  => $js,
                    );
                } elseif (isset($js['route'])) {
                    $js = array(
                        'path'  => $self->getGenerator()
                                        ->getContainer()
                                        ->get('router')
                                        ->generate($js['route'], $js['routeparams'])
                    );
                }

                $javascripts[] = $js;
            }

            return $javascripts;
        };

        // From config.yml
        $javascripts = $parse_javascripts(
            $this->getGenerator()->getContainer()
                 ->getParameter('admingenerator.javascripts', array()), array()
        );

        // From generator.yml
        $javascripts = $parse_javascripts(
            $this->getVariable('javascripts', array()), $javascripts
        );

        return $javascripts;
    }
public function getJavascripts ( ) { $ self = $ this ; $ parse_javascripts = function ( $ params , $ javascripts ) use ( $ self ) { foreach ( $ params as $ js ) { if ( is_string ( $ js ) ) { $ js = array ( 'path' => $ js , ) ; } elseif ( isset ( $ js [ 'route' ] ) ) { $ js = array ( 'path' => $ self -> getGenerator ( ) -> getContainer ( ) -> get ( 'router' ) -> generate ( $ js [ 'route' ] , $ js [ 'routeparams' ] ) ) ; } $ javascripts [ ] = $ js ; } return $ javascripts ; } ; // From config.yml $ javascripts = $ parse_javascripts ( $ this -> getGenerator ( ) -> getContainer ( ) -> getParameter ( 'admingenerator.javascripts' , array ( ) ) , array ( ) ) ; // From generator.yml $ javascripts = $ parse_javascripts ( $ this -> getVariable ( 'javascripts' , array ( ) ) , $ javascripts ) ; return $ javascripts ; }
Allow to add complementary javascripts


param:
javascripts:
- path/js.js
- { path: path/js.js }
- { route: my_route, routeparams: {} }

@return array
Allow to add complementary javascripts