Do you ever want a quick way to search PHP or Smarty Documentation for a function? Here it is! Just drag this link to your browsers bookmarks (or links) toolbar and voila!
These simple Smarty modifiers have made life easier for me. The use them just save the source code file, change the extension from .phps to .php, and put it in your Smarty plugins folder.
Coding Country select boxes can be a pain. This plugin uses the built-in html_options function in Smarty to return a html select box populated with ISO Country Codes and Names. It also allows for specification of a custom default country selection (So Canada can be your default if you live there).
Same as above but returns a html select box populated with US States and Canadian Provinces.
This is based on Matt Mullenweg's PHP Acronym Definer which will define all the acronyms it can using the acronym tag for any text you run through it. Just drop it in your Smarty plugins directory and register it. Then call it in your Smarty templates like this:
{$your_text|acronymit}
Widonts are a typographical no-no, and people all over the Web can tell you why. Fortunately, fixing them is very easy. One line of PHP can handle the chore:
preg_replace('|([^\s])\s+([^\s]+)\s*$|', '$1 $2', $string);
The issue is a clean, reusable way to access that function. Rather than add this to all your titles, headings, paragraphs, etc in your application code (where it really doesn't belong), just use this simple Smarty Modifier to do the trick. Once installed in your plugins directory you can just call it and automagically fix any problems.
{$your_text|widont}
J Cornelius is a software developer, Web developer, and Formula 1 fan in Atlanta GA. He has a strange affinity for odd numbers, european sports cars, thoughtful analogies, and is hopelessly addicted to chips & salsa. Read more
Was it good for you?
Post to Digg Post to del.icio.us Post to ma.gnolia Post to Furl Post to Mixx