<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Thu, 23 May 2013 08:39:33 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Extending Twig Templates: Inheritance, Filters, and Functions]]></title>
      <guid>http://www.phpdeveloper.org/news/19467</guid>
      <link>http://www.phpdeveloper.org/news/19467</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new tutorial for the <a href="http://twig.sensiolabs.org/">Twig</a> templating users out there showing you how to <a href="http://phpmaster.com/extending-twig-templates-inheritance-filters-and-functions/">extend your templates</a> via inheritance, filters and functions - all abilities already built in to the tool.
</p>
<blockquote>
When working within an MVC architecture, it's common to use a template library to populate the dynamic content of our views. There are dozens of such libraries available for PHP, but Twig is one of the standouts because of the ability to extend core features with custom implementations. In this article we'll explore how Twig templates can be extended using template inheritance, filters, and functions.
</blockquote>
<p>
He starts first with some of the common limitations of templating frameworks (extension) and how Twig gets around this. He shows the use of the "extends" keyword and the "block"/"endblock" for splitting up the page into reusable chunks. He also shows how to use filters and functions in your Twig tags, allowing for more customized content and functionality for your output.
</p>
Link: http://phpmaster.com/extending-twig-templates-inheritance-filters-and-functions/]]></description>
      <pubDate>Tue, 16 Apr 2013 11:05:22 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[SitePoint PHP Blog: Should You Close Your PHP Code Tags?]]></title>
      <guid>http://www.phpdeveloper.org/news/15158</guid>
      <link>http://www.phpdeveloper.org/news/15158</link>
      <description><![CDATA[<p>
On the SitePoint PHP blog there's a new post with an interesting question for PHP developers that might go against how they were tought to code from their early days - should you <a href="http://blogs.sitepoint.com/2010/09/18/should-you-close-your-php-code-tags/">close your PHP tags</a> at the end of your code?
</p>
<blockquote>
Even those with a modest grasp of PHP know that code must be enclosed within special <?php and ?> tags. [...] However, if your file contains just PHP - and no escaped HTML code - the closing ?> tag is entirely optional. Many developers argue that unnecessary code should be removed but there's another reason you could consider scrapping the closing tag.
</blockquote>
<p>
Their rationale is that, in some situations, extra characters or other information could pop up after that closing PHP tag and cause problems in your code. If you drop the closing tag completely, there's no risk that this could happen and PHP parses it the same way.
</p>
<p>
There's <a href="http://blogs.sitepoint.com/2010/09/18/should-you-close-your-php-code-tags/#comments">lots of great comments</a> with opinions both for and against.
</p>]]></description>
      <pubDate>Mon, 20 Sep 2010 13:34:22 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Marco Tabini's Blog: The origin of the &lt;blink> tag ]]></title>
      <guid>http://www.phpdeveloper.org/news/14619</guid>
      <link>http://www.phpdeveloper.org/news/14619</link>
      <description><![CDATA[<p>
In a recent post to his blog <i>Marco Tabini</i> talks about <a href="http://blog.tabini.ca/2010/06/the-origin-of-the-blink-tag">the "monkey on the back" syndrome</a> that affects so much of the technology projects these days. His example for PHP? register_globals.
</p>
<blockquote>
One such example is the register_globals setting in PHP which finally managed to get deprecated in PHP 5.3 (and, the way things are going, may never disappear altogether) after much fighting and gnawing of teeth. [...] The existence of register_globals is problematic in many ways, but it is consistent: as long as you have a version of PHP that supports it installed, you will have the opportunity to use it1. When it is discarded, it ceases to exist, so that rewriting your code becomes a prerequisite to upgrading to a new version of PHP.
</blockquote>
<p>
He also relates it to a &lt;blink> tag - something that really shouldn't be used any more but, because someone decided it was a good idea in the past, several browsers have included support for it. The moral of the story? Well-planned standards are a good thing.
</p>]]></description>
      <pubDate>Tue, 08 Jun 2010 11:33:21 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Moon's Blog: The history of PHP eating newlines after the closing tag]]></title>
      <guid>http://www.phpdeveloper.org/news/12065</guid>
      <link>http://www.phpdeveloper.org/news/12065</link>
      <description><![CDATA[<p>
<i>Brian Moon</i> <a href="http://brian.moonspot.net/php-history-newline-closing-tag">points out</a> a (sometimes annoying) habit of PHP when it comes to newlines - it drops them after the closing tag.
</p>
<blockquote>
Have you ever noticed that PHP eats the newlines after a closing PHP tag?  Not sure what I mean?  There is lots on <a href="http://www.google.com/search?q=php+newline+close+tag">Google about it</a>. [...] So, why does PHP do this?  Well, you have to <a href="http://marc.info/?t=90279165800002&r=1&w=2">go back 11 years</a>.  PHP 3 was emerging.  I was just starting to use it for <a href="http://www.phorum.org/">Phorum</a> at the time.  There were two reasons.
</blockquote>
<p>
The first reason was the it, at least in the minds of the developers of the language, "removed all traces of PHP" from the script without any training newlines to show for it. The second case was a bit more valid - because lots of editors at the time required newlines at the end of every line of code. This caused loads of trouble tracking down things like the infamous "Headers already sent" issues (pre-output buffering).
</p>]]></description>
      <pubDate>Wed, 04 Mar 2009 11:13:47 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[NETTUTS.com: Building a jQuery-Powered Tag-Cloud]]></title>
      <guid>http://www.phpdeveloper.org/news/11842</guid>
      <link>http://www.phpdeveloper.org/news/11842</link>
      <description><![CDATA[<p>
<i>Dan Wellerman</i> has <a href="http://nettuts.com/tutorials/javascript-ajax/building-a-jquery-powered-tag-cloud/">written up a tutorial</a> for NETTUTS.com about making a jQuery and PHP-powered tag cloud out of the tagging already a part of your site.
</p>
<blockquote>
Aside from the actual links themselves, which give people an idea of the subjects that your site covers, they can also show how popular the different subjects are. Another great thing about tag-clouds is that they can be used to describe the frequency of anything; you can link to articles, blog posts, images, video, or anything else that you have in abundance on your site.
</blockquote>
<p>
The javascript makes an Ajax call back to a PHP script waiting in the background (that pulls the tags out of their example database). It puts them into a JSON format and pushes them back out to the script, though they should have gone with <a href="http://php.net/json_encode">json_encode</a> instead of their own partial soltuon.
</p>
<p>
The jQuery then parses the JSON message back out and drops it into CSS styled divs already in the page. As always, <a href="http://nettuts.s3.amazonaws.com/191_tagCloud/tagcloud_sourceFiles.zip">the source</a> in available for download.
</p>]]></description>
      <pubDate>Thu, 29 Jan 2009 17:30:03 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[NETTUTS.com: Context Includes]]></title>
      <guid>http://www.phpdeveloper.org/news/11216</guid>
      <link>http://www.phpdeveloper.org/news/11216</link>
      <description><![CDATA[<p>
The NETTUTS blog has another <a href="http://nettuts.com/working-with-cmss/context-includes/">WordPress-related post</a> today that looks at "context includes" - changing the look and feel of the postings based on the content type they're tagged with.
</p>
<blockquote>
The great thing about WordPress is that it doesn't limit how content is displayed, but provides a 'framework' of ways to do so. Even better, it's possible to change the display according to the content. When writing this tutorial it was hard to explain what's going on... But the best way is this: the post will be displayed within the loop according to its content - or contextual differences. Either way, it's including specific files that match up to the category of the post.
</blockquote>
<p>
There's plenty of <a href="http://nettuts.com/working-with-cmss/context-includes/">code to go around</a> introducing you to the parts of the typical WodPress install you'll be working with and some CSS to help you style the resulting changes. You can download the <a href="http://nettuts.s3.amazonaws.com/092_contextIncludes/contextIncludes.zip">source</a> and check out <a href="http://nettuts.s3.amazonaws.com/092_contextIncludes/preview/index.html">a live demo</a> of the end result.
</p>]]></description>
      <pubDate>Wed, 15 Oct 2008 10:23:51 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Douglas Brown's Blog: Twitter Tag Cloud Service]]></title>
      <guid>http://www.phpdeveloper.org/news/10745</guid>
      <link>http://www.phpdeveloper.org/news/10745</link>
      <description><![CDATA[<p>
<i>Douglas Brown</i> has put together <a href="http://www.brownphp.com/2008/08/twitter-tag-cloud-service/">an announcement</a> for a web service he's come up with (and made available for <a href="http://www.brownphp.com/downloads/TwitterTagCloud.zip">download</a>) to make a tag cloud out of the top keywords from your twitter feed.
</p>
<blockquote>
The problem I was having was actually judging whether or not it would be worth my time following their tweets. I mean, I follow someone that is really respected in a certain field, only to find out that they tweet about their new puppy they just got more than anything. So I made a PHP script that generates a "Twitter Tag Cloud."  Using this, you can generate your own Twitter tag cloud to put on your personal site to display the top keywords that you have been tweeting about.
</blockquote>
<p>
You can either check out an example of the cloud through the form <a href="http://www.brownphp.com/2008/08/twitter-tag-cloud-service/">in the post</a>, use his REST service to get the keywords for a user or you can <a href="http://www.brownphp.com/downloads/TwitterTagCloud.zip">download his code</a> and try it out for yourself.
</p>]]></description>
      <pubDate>Fri, 01 Aug 2008 14:28:11 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Moon's Blog: Stupid PHP Tricks: Normalizing SimpleXML Data]]></title>
      <guid>http://www.phpdeveloper.org/news/10328</guid>
      <link>http://www.phpdeveloper.org/news/10328</link>
      <description><![CDATA[<p>
<i>Brian Moon</i> has a "stupid PHP trick" posted to his blog today - <a href="http://brian.moonspot.net/2008/06/03/stupid-php-tricks-normalizing-simplexml-data/">normalizing SimpleXML data</a> you've pulled in from just about any external source.
</p>
<blockquote>
Anyhow, one annoying thing about SimpleXML has to do with caching.  When using web services, we often cache the contents we get back.  We were having a problem where we would get an error about a SimpleXML node not existing.
</blockquote>
<p>
They were using memcache to store the information but came across problems when their code tried to use a (sometimes) empty tag. He gives two solutions - one using a recursive function that identifies the empty items and the other that encodes then decodes the object to and from JSON, keeping the values intact.
</p>]]></description>
      <pubDate>Tue, 03 Jun 2008 09:34:22 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Developer Tutorials Blog: Building Web 2.0 Tag Clouds in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/10100</guid>
      <link>http://www.phpdeveloper.org/news/10100</link>
      <description><![CDATA[<p>
The Developer Tutorials blog has posted <a href="http://www.developertutorials.com/blog/php/building-web-2-0-tag-clouds-in-php-165/">a tutorial</a> showing you how to set up a tag cloud for your site:
</p>
<blockquote>
Every major website seems to have a tag cloud. Users love tag clouds; they help navigate masses of content quickly and easily. [...] How do we actually build a tag cloud at application level? In this tutorial, I'll take you through putting together a full-blown, calculated web 2.0 tag cloud in PHP.
</blockquote>
<p>
They <a href="http://www.developertutorials.com/blog/php/building-web-2-0-tag-clouds-in-php-165/">start</a> at the end, with an example cloud with some sample tags ("php" being the largest, of course). The code for it is pretty simple - it looks at an array of counts, the number of times the tag is used, and builds the links with the correct font size automatically. 
</p>]]></description>
      <pubDate>Fri, 02 May 2008 13:15:27 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Maggie Nelson's Blog: NTILE() - easy way to generate tag clouds]]></title>
      <guid>http://www.phpdeveloper.org/news/10067</guid>
      <link>http://www.phpdeveloper.org/news/10067</link>
      <description><![CDATA[<p>
For the Oracle users out there looking for an easy way to pull those tags together and make a handy little cloud out of them, <i>Maggie Nelson</i> has <a href="http://www.objectivelyoriented.com/2008/04/ntile_easy_way_to_generate_tag.html">posted about</a> a simple Oracle function that can help - NTILE.
</p>
<blockquote>
For example, check out the documentation for the NTILE Function. Yeah, sounds kind of boring. What good could it be in the wonderful world of web development? After all, who manages employee or sales tables anymore... Answer: generating tag clouds. 
</blockquote>
<p>
Her SQL statement categorizes the tags for you automatically, dropping them in to "buckets" of font sizes. This makes it simple to loop through them (like with a foreach) and output your tags with a little help from some CSS. You can even specify how many buckets you want it to fill (how many different tag values to get and compare).
</p>
]]></description>
      <pubDate>Tue, 29 Apr 2008 13:44:01 -0500</pubDate>
    </item>
  </channel>
</rss>
