public function getRoute(AdminInterface $admin, $action, $params = [], $isIndex = false)
    {
        $defaults = [];
        $path = '/' . $admin->getAlias();

        // append action if required
        if(!$isIndex) {
            $path .= '/' . $action;
        }

        foreach($params as $paramKey => $paramValue) {
            if(is_int($paramKey)) {
                $paramName = $paramValue;
            }
            else {
                $paramName = $paramKey;
                $defaults[$paramName] = $paramValue;
            }
            $path .= '/{' . $paramName . '}';
        }

        $controller = 'ShuweeAdminBundle:Content:' . $action;

        $defaults = array_merge(
          [
            '_controller' => $controller,
            'alias' => $admin->getAlias(),

          ],
          $defaults
        );

        return new Route($path, $defaults);
    }
public function getRoute(AdminInterface $admin, $action, $params = [], $isIndex = false)
    {
        $defaults = [];
        $path = '/' . $admin->getAlias();

        // append action if required
        if(!$isIndex) {
            $path .= '/' . $action;
        }

        foreach($params as $paramKey => $paramValue) {
            if(is_int($paramKey)) {
                $paramName = $paramValue;
            }
            else {
                $paramName = $paramKey;
                $defaults[$paramName] = $paramValue;
            }
            $path .= '/{' . $paramName . '}';
        }

        $controller = 'ShuweeAdminBundle:Content:' . $action;

        $defaults = array_merge(
          [
            '_controller' => $controller,
            'alias' => $admin->getAlias(),

          ],
          $defaults
        );

        return new Route($path, $defaults);
    }
public function getRoute ( AdminInterface $ admin , $ action , $ params = [ ] , $ isIndex = false ) { $ defaults = [ ] ; $ path = '/' . $ admin -> getAlias ( ) ; // append action if required if ( ! $ isIndex ) { $ path .= '/' . $ action ; } foreach ( $ params as $ paramKey => $ paramValue ) { if ( is_int ( $ paramKey ) ) { $ paramName = $ paramValue ; } else { $ paramName = $ paramKey ; $ defaults [ $ paramName ] = $ paramValue ; } $ path .= '/{' . $ paramName . '}' ; } $ controller = 'ShuweeAdminBundle:Content:' . $ action ; $ defaults = array_merge ( [ '_controller' => $ controller , 'alias' => $ admin -> getAlias ( ) , ] , $ defaults ) ; return new Route ( $ path , $ defaults ) ; }
Build a route for a given admin and action.

@param \Wanjee\Shuwee\AdminBundle\Admin\AdminInterface $admin
@param string $action
@param array $params
@param bool $defaultRoute

@return \Symfony\Component\Routing\Route
Build a route for a given admin and action .