Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Symfony Finland:
What's on the Menu, Symfony?
Jan 28, 2016 @ 17:49:13

On the Symfony Finland site they've posted a tutorial about Symfony and menus, making use of the KnpMenuBundle to create flexible and easily configured menus with their own renderers.

Menus are a vital part of any web application or a website. Content Management Systems are traditionally a strong contender in this field as they are at their core just tools to create navigatable views to a pool of content. The Symfony Framework on the other hand is neutral when it comes to menus.

[...] There are a number of options for building menus in PHP, but the de-facto standard method for Symfony Framework is the KnpMenuBundle. It uses the KnpMenu library which is an object oriented PHP library for constructing and rendering menus.

The tutorial provides a simple example of using the bundle to create a menu with a handful of options and rendering it with a simple (included) ListRenderer. There's also an example of using a YAML configuration to create the menu and some example code of using a bit more complex and dynamic menu. They also talk a bit about content management systems, their use of menus and which they see as providing a better user experience than the others.

tagged: menu tutorial knpmenubundle symfony cms knplabs

Link: https://www.symfony.fi/entry/whats-on-the-menu-symfony


Trending Topics: