model view controller - Building a menu the MVC way in PHP -


Hello I am creating my own PHP MVC framework, not with the intention of using it. But I'm trying to learn PHP5 OO and MVC design patterns.

I have read a lot of tutorials and have worked the basics, but now I get stuck because things are getting more complicated.

My framework uses the following URL structure: / Controller / Action Alternatively after a unique number of variables, eg. / Product / View / 1.

By now I have received two different controllers: the page and the product I do not want to include them in the same menu. Corrosponding URL I am trying to install the following menu structure is between parentheses.

  • Our company (/ page / view / 2)
    • Werkwijze (/ page / view / 3)
    • Staff (/ Product / Category / 1
    • Cake (/ Products / Category / 3)
    • Contact ( / Page / view / 5)

    So basically I found a main menu and a sub menu for the menu class, I have set some essential requirements:

    • The current item should have a separate CSS class in the menu.
    • If there is a parent compared to the current item
    • and for bonus points: when I select a product with bread class. Assume / Product / View / 1; So I would like to highlight 'our product' and 'roti' menu items too.

    Here's a copy of my 'framework' walk:. The content is in Dutch though and the menu is just static HTML.

    The source code is also available for download in the folder:

    • / stackoverflow / source / framework .zip
    • / stackoverflow / source / framework Sql

    Any other comment on my code is also welcome: p.

All code must be in the view layer of the application. Of course, the framework should be provided in ways to know the types of modules and actions, but the behavior of the menu should be applied in the application and not in the framework.

Another option should be outlined so that it provides some assistants to automatically create the menu. In this case, everyone should be implemented within the visual layer of the structure.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -