Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

CHAPTER 15: Wrapping Up the Application > Generating Dynamic Navigation

Generating Dynamic Navigation

More complex navigation will likely require creating some kind of menu system in the application. The blog is already equipped to handle categories and rendering posts. It's easy to make a menu that is rendered in every view. (Displaying a menu is a good time to use an element instead of a layout or a helper.)

You could create a menu element like I've done with Listing 15-1 and call it in the various views throughout the site. Notice that I've checked the Session component to see whether the user is logged in, changing what links are available to the user accordingly. Of course, the login process would need to be built, preferably with the Auth component, but the element does work well for adjusting the interface to supply the links based on the status of the user's session.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial