Coder Social home page Coder Social logo

nan-guo / sonata-menu-bundle Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 19.0 642 KB

This bundle provides menu management by sonata admin bundle (compatible with sonata page bundle).

License: MIT License

PHP 76.28% CSS 6.93% Twig 16.80%
sonata sonata-menu-admin

sonata-menu-bundle's People

Contributors

dill44 avatar jihell avatar jonathanbaudoin avatar luminatus avatar nan-guo avatar nme84 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sonata-menu-bundle's Issues

when delete childen item entity delete parent and all other childens.

the relation entity parent is cascade remove and childen cascade on all

* @ORM\ManyToOne(targetEntity="\Prodigious\Sonata\MenuBundle\Model\MenuItemInterface", inversedBy="children", cascade={"remove", "persist"})

* @ORM\OneToMany(targetEntity="\Prodigious\Sonata\MenuBundle\Model\MenuItemInterface", mappedBy="parent", cascade={"all"})

so when you delete a children, model delete parent and all parent's childrens

Change EntityManager in MenuManager.php

Hi !

First, great bundle, it's very useful !

You may change the service called in the construct of the class Manager/MenuManager.php to avoid issue with recents versions of Symfony :

public function __construct(EntityManager $em)
to
public function __construct(EntityManagerInterface $em)

Thanks

Compatibility Symfony 3 / Sonata

Hi!

First of all, great bundle!

I was trying it out in a Symfony 3.4 project with the newest Sonata Admin bundle and found some bugs related to these versions I think. Would love to create a pull request to fix it but I wonder if you need the Symfony 2.8 compatibility ? Since your bundle has just been released.

Fix Argument must be of the type string, null given

Argument 1 passed to Knp\Menu\MenuFactory::createItem() must be of the type string, null given, called in D:\projekty\wisdomfactory\sonata-default\private\vendor\knplabs\knp-menu\src\Knp\Menu\MenuItem.php on line 332

Problem with routes

I have problem with routes on Symfony4.
Everything configured as you've written.

Having this kind of error:
An exception has been thrown during the rendering of a template ("Unable to generate a URL for the named route "admin_sonata_menu_menu_create" as such route does not exist.").

What is strange, I could notice some similar routes but not quite the same:
My router:debug returns:

admin_app_menu_list ANY ANY ANY /admin/sonata/menu/list
admin_app_menu_create ANY ANY ANY /admin/sonata/menu/create
admin_app_menu_batch ANY ANY ANY /admin/sonata/menu/batch
admin_app_menu_edit ANY ANY ANY /admin/sonata/menu/{id}/edit
admin_app_menu_delete ANY ANY ANY /admin/sonata/menu/{id}/delete
admin_app_menu_show ANY ANY ANY /admin/sonata/menu/{id}/show
admin_app_menu_export ANY ANY ANY /admin/sonata/menu/export
admin_app_menu_menuitem_list ANY ANY ANY /admin/sonata/menu/{id}/sonata/menu/menu-item/list
admin_app_menu_menuitem_create ANY ANY ANY /admin/sonata/menu/{id}/sonata/menu/menu-item/create
admin_app_menu_menuitem_batch ANY ANY ANY /admin/sonata/menu/{id}/sonata/menu/menu-item/batch
admin_app_menu_menuitem_edit ANY ANY ANY /admin/sonata/menu/{id}/sonata/menu/menu-item/{childId}/edit
admin_app_menu_menuitem_delete ANY ANY ANY /admin/sonata/menu/{id}/sonata/menu/menu-item/{childId}/delete
admin_app_menu_menuitem_show ANY ANY ANY /admin/sonata/menu/{id}/sonata/menu/menu-item/{childId}/show
admin_app_menu_menuitem_export ANY ANY ANY /admin/sonata/menu/{id}/sonata/menu/menu-item/export
admin_app_menu_menuitem_toggle ANY ANY ANY /admin/sonata/menu/{id}/sonata/menu/menu-item/{childId}/toggle
admin_app_menu_items ANY ANY ANY /admin/sonata/menu/{id}/items
admin_app_menuitem_list ANY ANY ANY /admin/sonata/menu/menu-item/list
admin_app_menuitem_create ANY ANY ANY /admin/sonata/menu/menu-item/create
admin_app_menuitem_batch ANY ANY ANY /admin/sonata/menu/menu-item/batch
admin_app_menuitem_edit ANY ANY ANY /admin/sonata/menu/menu-item/{id}/edit
admin_app_menuitem_delete ANY ANY ANY /admin/sonata/menu/menu-item/{id}/delete
admin_app_menuitem_show ANY ANY ANY /admin/sonata/menu/menu-item/{id}/show
admin_app_menuitem_export ANY ANY ANY /admin/sonata/menu/menu-item/export
admin_app_menuitem_toggle

Which is quite different regarding the error.

Fix sonata.core.slugify.cocur

You have requested a non-existent service "sonata.core.slugify.cocur". Did you mean this: "sonata.page.slugify.cocur"?

How to display the created menu in frontend

I've installed this menu bundle and it works fine in admin like your snapshots. Now I want to add this menu to sonata page builder's dropdown to display it in frontend. How can I do this? Can you guide me?

FYI : I'm using symfony 4 and below sonata bundles are used in my project.

        "sonata-project/admin-bundle": "^3.51",
        "sonata-project/block-bundle": "^3.17",
        "sonata-project/cache-bundle": "^2.4.2",
        "sonata-project/datagrid-bundle": "^2.5.0",
        "sonata-project/doctrine-orm-admin-bundle": "^3.10",
        "sonata-project/media-bundle": "^3.20",
        "sonata-project/notification-bundle": "^3.6",
        "sonata-project/page-bundle": "^3.11",
        "sonata-project/seo-bundle": "^2.7",

Thanks in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.