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

Adam Culp:
Zend Framework 2 XML Sitemap
Sep 09, 2013 @ 16:15:09

In a new post to his site Adam Culp shares how he created an XML sitemap for his Zend Framework 2-based application as he made it (the SunshinePHP site) more SEO friendly.

I was pleasantly surprised to see the Navigation component of Zend Framework 2 includes a bunch of view helpers, including a Sitemap helper. So now I have an xml sitemap created by Zend Framework 2 that works hand in hand with the site navigation. However, the documentation was not complete as of this writing and caused me to do a bit of trial and error debugging to get it working. Below I will post how I got it working, in hopes it will help others.

The code to get it working is relatively simple - set it up in the module configuration, specify the navigation structure and add a route for the sitemap output. The view then accesses the navigation handling and calls a "sitemap" method to push the XML result out to the user.

tagged: xml sitemap sunshinephp zendframework2 navigation helper

Link: http://www.geekyboy.com/archives/770

Rob Allen:
Integrating BjyAuthorize with ZendNavigation
Nov 20, 2012 @ 19:57:09

Rob Allen has posted a technique for integrating the BjyAuthorize, a helpful module for access control in your Zend Framework 2 application, with the ZendNavigation module for user permissions-based navigation updates.

If you are using BjyAuthorize for ACL configuration and want to use ZendNavigation's ZendAcl integration features, then you need to set the Acl and Role information into ZendNavigation.

He includes the code you'll need to add to both the bootstrap of your application and the configuration to set up the "rule_providers" and "resource_providers". Then you can update your navigation settings to include "resource" and "rule" options to define with options a user can see.

tagged: zendframework2 tutorial bjyauthorize acl navigation module

Link:

Adam Lundrigan:
Quick-and-dirty ZF2: ZendNavigation
Jul 26, 2012 @ 17:19:27

On Adam Lundrigan's site there's a new post introducing you to the ZendNavigation component of the Zend Framework v2 project and a simple example using it to display a few links.

He breaks it up into a few smaller steps:

  • Add Service Manager Factory
  • Configure Sitemap
  • Using the View Helpers

You can find out more about the ZendNavigation component here.

tagged: zendframework2 navigation tutorial introduction

Link:

Brandon Savage's Blog:
An Intro To Zend_Navigation
Mar 30, 2010 @ 18:33:08

As he progresses more in his work with the Zend Framework (and learns along the way) Brandon Savage is sharing some of the handy new things he's come across. In his latest post he looks at the Zend_Navigation component and gives you an overview of how it all works.

I wanted to write a primer that others could use to get started with Zend_Navigation. This is a short guide to how Zend_Navigation works, and how you can use it to improve your application.

His primer starts with a bit of vocabulary you'll need to know before you get started - things like MVC pages, URI pages and containers. He helps you create Zend_Navigation-enabled pages, both a simple one that just makes an object and a more complex one that uses a tree structure (as defined in an array) to help build the navigation element.

tagged: zendnavigation navigation configuration tutorial

Link:

Tiger Heron Blog:
First steps with PHP - booting a script, Part 1
Mar 19, 2008 @ 13:48:48

On the Tiger Heron blog, there's a continuation of the series that Tony Freixas has been writing to following the beginning steps of working with PHP. First there was the download/install, then setting up a development environment. This time, he actually gets around to writing a bit of basic code.

Specifically, I will describe how I boot my PHP scripts and why I boot them the way I do. Part 1 shows how my requirements for code portability and maintainability influence the boot process. Part 2 will go into more detail about the specific steps executed by the boot code.

His basic task for the first example is to make a templating sort of system, calling a Navigation class to output links in list items. He outlines the goals of the project, what he's found for his current solution and some alternatives he's discovered along the way.

tagged: development tutorial series environment task navigation

Link:

Tiffany Brown's Blog:
Turn text files into pull down menus
Feb 27, 2008 @ 15:35:00

Tiffany Brown shares a quick function she whipped up to create dropdown menus from the contents of a newline separated text file (or files).

I developed this PHP function for a project I'm working on. I'm posting it here in case I need it again, or in case you find it handy.

The function turns each line into an option tag making defining custom menus based on the contents of dynamically-given text files easy.

This could also be easily adapted to create navigations menus at the top of your pages with a few modifications to the HTML tags being used and some CSS to change the look of the list.

tagged: text file dropdown menu form element navigation css

Link:

The Bakery:
Five New Articles, Tutorials and Helpers
Sep 11, 2007 @ 14:29:00

The Bakery has five new items they've recently posted - a few new articles, helper information and tutorials. Here's the list:

  • CSV Helper - I was recently outputting some comma-delimited data and thought I would benefit from a simple csv helper
  • p28n, the top to bottom persistent internationalization tutorial - For some developers, allowing a website to support multiple languages is essential. Luckily cakePHP 1.2 has the foundations available to make this possible.
  • Tracking navigation history of a user - Many times it can be very useful to track the navigation history of a user. [...] With this HistoryComponent, it's extremely easy to handle such actions.
  • Habtm hacks to menage columns in both models - I had a habtm relationship between two models and when i did a "findall" in a model i couldn't filter the rows with a clause from the the other model.
  • SecureGet Component - I am not pretending this can replace ACL or more complex implementation, it's just a small component, inspired a bit from the Security component.

If you're a CakePHP developer, you'd do well to check out The Bakery for these and more great Cake-related articles, tutorials and information.

tagged: csv internationalization navigation habtm secureget bakery csv internationalization navigation habtm secureget bakery

Link:

The Bakery:
Five New Articles, Tutorials and Helpers
Sep 11, 2007 @ 14:29:00

The Bakery has five new items they've recently posted - a few new articles, helper information and tutorials. Here's the list:

  • CSV Helper - I was recently outputting some comma-delimited data and thought I would benefit from a simple csv helper
  • p28n, the top to bottom persistent internationalization tutorial - For some developers, allowing a website to support multiple languages is essential. Luckily cakePHP 1.2 has the foundations available to make this possible.
  • Tracking navigation history of a user - Many times it can be very useful to track the navigation history of a user. [...] With this HistoryComponent, it's extremely easy to handle such actions.
  • Habtm hacks to menage columns in both models - I had a habtm relationship between two models and when i did a "findall" in a model i couldn't filter the rows with a clause from the the other model.
  • SecureGet Component - I am not pretending this can replace ACL or more complex implementation, it's just a small component, inspired a bit from the Security component.

If you're a CakePHP developer, you'd do well to check out The Bakery for these and more great Cake-related articles, tutorials and information.

tagged: csv internationalization navigation habtm secureget bakery csv internationalization navigation habtm secureget bakery

Link:

Felix Geisendorfer's Blog:
MacGyver menu for CakePHP - What's the active menu item?
Jul 09, 2007 @ 14:34:00

In a new post to his blog today, Felix Geisendorfer talks about view coding - specifically working with a menu and determining which element is active.

One of the challenges many of us have faced before and will face in future is building a menu. Now this of course is very simple assuming that we're just shooting for a static <ul> with some <li>'s containing the links. However the tricky part is to figure out what is the active menu item. I had some code doing this in the past but tried out a new flavor of it today which I call the MacGyver menu for CakePHP as it's a little dirty yet powerful and easy to maintain.

In his included code, he creates a simple navigation from an array of titles/links and, with some sorting, a regular expression and a CSS class, the selected item can be highlighted simply.

tagged: cakephp framework navigation highlight active menu cakephp framework navigation highlight active menu

Link:

Felix Geisendorfer's Blog:
MacGyver menu for CakePHP - What's the active menu item?
Jul 09, 2007 @ 14:34:00

In a new post to his blog today, Felix Geisendorfer talks about view coding - specifically working with a menu and determining which element is active.

One of the challenges many of us have faced before and will face in future is building a menu. Now this of course is very simple assuming that we're just shooting for a static <ul> with some <li>'s containing the links. However the tricky part is to figure out what is the active menu item. I had some code doing this in the past but tried out a new flavor of it today which I call the MacGyver menu for CakePHP as it's a little dirty yet powerful and easy to maintain.

In his included code, he creates a simple navigation from an array of titles/links and, with some sorting, a regular expression and a CSS class, the selected item can be highlighted simply.

tagged: cakephp framework navigation highlight active menu cakephp framework navigation highlight active menu

Link:


Trending Topics: