On the SocialGeek blog there's a recent post that looks at making stubs for your URLs, making them easier to read and remember.
This is where the fun begins of course. How many times have you been confronted with someone sending you an indecipherable, thus untrustworthy link? Right, so we agree that for a user, it is important to have a clean URL that is readable and includes the title of the page or (at least) some description related to the content. Slug time!
They explain what slugs are (and how they're useful for users) as well as how to convert a title into a "slugged" string by replacing anything that's not an A-Z or 0-9 character to remove the less URL friendly characters.
Robert Basic has posted a view helper for the Zend Framework he's developed - one to more correctly handle URLs without dropping the query string information.
Zend Framework's built in URL view helper - Zend_View_Helper_Url - is discarding the query string of the URL, thus breaking some links.
The included helper for URL building formats the output in a slightly unexpected way, so his helper uses this format and, with the help of a few loops and some string appending, spits a "more correct" version out the other side. Complete code and a usage example are included.
In this new post today Raphael Stolt shows how to use the Zend_Http_Client component of the Zend Framework to "tinyize" a URL.
In a recent blog post Dave Marshall outlined a quick workaround for tweeting via the Zend_Http_Client component which is a reasonable approach for calling services that aren't in the Zend Framework core yet like Zend_Service_Twitter or are not supported out of the box. Therefore this post will try to describe a Zend Framework way of creating tinyized URLs.
He creates a UrlShorterner interface containing a shortenize() method that automates sending a URL over to the tinyurl.com web service and returning the results.
Asvin Balloo has posted a quick look at making the URLs of your website a bit more "pretty" and SEO-friendly.
When I started implementing mod_rewrite in websites I had a problem in PHP as how to make a SEO friendly URL. All tutorials were geared towards how to implement mod_rewrite, about modifying .htaccess files, but none treated how to make the urls friendly with dynamic content.
He shares a function that he found that helped him a great deal - a method called friendlyURL. It changes a bit of text into a more friendly version of itself ("this is a test" becomes "this-is-a-test") that can be used in anything you'd want. An example could be in automatically generating links to other pages on your site that search engines can easily follow.
Matthew Turland has posted a quick tutorial where he aims to simplify some of the functionality that the Zend Framework's Zend_View_Helper_Url view helper has to offer.
When I first began working with Zend_View on a project at work, I noticed that the Url view helper was a bit of a pain to use. It was rare that I didn't want to specify one or more of the action, controller, and module in my call along with the other Route assembly parameters.
He wanted to be able to get around some limitations of the helper - use arrays to help label the calls more readable and to be able to refer to other actions in the same controller. He actually made another view helper, one that extends Zend_View_Helper_Url with a few optional parameters including the extra data he wanted in an array. You can see the code at the bottom of his post (he credits Andy Best with development on the idea too).
This new post from the Mind Tree blog (at hurricanesoftware.com) asks the question "why do you care about friendly URLs in PHP applications?"
Nice URLs, readable URLs, search-engine-friendly URLs. Different names same deal. [...] Turns out this isn't all that hard with PHP - in fact it can turn into something that's very useful from more than just a readability viewpoint.
He shows how to use mod_rewrite and an .htaccess file to automatically grab the request and map it to the right place. Then, the PHP script looks at the incoming data and pushes the correct page back out to the browser. He's also included some modifications to the original idea that allow for numeric grouping and named groups for rewriting content.
Rob Allen has posted a new entry on getting a Zend Framework application to run correctly even though mod_rewrite (or ISAPI_Rewrite) isn't up and running.
Some of our Zend Framework applications have to run on IIS without ISAPI_Rewrite installed. In these cases we need urls of the form http://www.example.com/index.php?module=mod&controller=con&action=act. I couldn't get this to work out of the box with Zend Framework 1.5, so wrote my own router called App_Controller_Router_Route_RequestVars.
Most of the post is the code for the router (ready for you to cut and paste) but he's also included a usage example of it so you can easily update your bootstrap file to use it.
Padraic Brady has an addendum he's posted to his "making a blogging application with the Zend Framework" series dealing with a few random issues from along the way.
The interesting thing about live publishing of a long tutorial series is that it's not flawless. In fact it's the opposite. [...] To cover all these I'll occasionally highlight the more important ones both in notes to new entries, or where they slip past me, in Addendum entries like this one.
There's four sections in this update - one dealing with the referencing of base URLs, another worrying about magic_quotes settings, an updated database schema for the project and the final about removing non-english characters in the title URLs.
Padraic Brady has posted part seven of his series on building a blogging application with the Zend Framework as a base. This time he's working on the output of the entries - using Zend_View to standardize the look and feel.
In previous parts we've been using View Helpers without even noticing it. Zend_Form doesn't generate forms by itself, rather it delegates most of the HTML generation to a set of View Helpers like Zend_View_Helper_Form. The problem with such output, is that View Helpers can only generate XHTML 1.0 Strict output if we actually inform them of the standard to use. [...] What we should do, is make the Doctype of our View more dynamic. This is achievable by using the Doctype View Helper.
Padraic talks about the different parts of the View layer in the framework (helpers, partials, placeholders) that were mentioned in previous parts. He shows how to change up his current setup to work with the Doctype View Helper to change the view and make it UTF-8 compliant.
He shows the changes to the bootstrap file, how he's grabbing the entries from the database and how he pushes that out to the view to be displayed. He also creates a custom view helper to create the entry URLs for each of the posts (Wordpress users out there, these are the stubs).
Evan Sims, a recent convert from Flickr to SmugMug, has whipped up a little something to help make getting to those SmugMug unfriendly URLs a little bit easier - SmugUrl:
one aspect I didn't like was their URL scheme. They have good reasons for doing it, and I can't fault them for trying to maintain the privacy and security of their users. Heck, I applaud them for it. Still, I like my URLs pretty, and more importantly search engine friendly. So, I decided to take matters into my own hands and build SmugURL.