View Single Post
  #2  
Old 09-24-2019, 08:44 AM
 
Ed B. Ed B. is offline
 

X-Adept
  
Join Date: Apr 2016
Posts: 446
 

Default Re: Hide Menu Item Unless Member

I guess it suffices to
  • create a @ManyToMany relations between the entities in models "menus" and "membership"
  • in your appropriate view class, define a function that tells if the user's membership is in related to the menu item
  • in appropriate twig file, you make sure that the menu item appears only if (s)he has the right membership using the function above
Of course, there will be usual routine routine writing of codes to edit the relations, add a an admin menu to open the editing page, etc. etc., unless you want to deal with the sql database directly.
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote