<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Kapusta Brothers &#187; Zend Framework</title>
	<atom:link href="http://www.kapustabrothers.com/category/web-tech/zend-framework-web-tech/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kapustabrothers.com</link>
	<description></description>
	<lastBuildDate>Wed, 26 Oct 2011 12:13:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Creating Filler Content with Zend Framework</title>
		<link>http://www.kapustabrothers.com/2010/08/29/creating-filler-content-with-zend-framework/</link>
		<comments>http://www.kapustabrothers.com/2010/08/29/creating-filler-content-with-zend-framework/#comments</comments>
		<pubDate>Sun, 29 Aug 2010 14:14:10 +0000</pubDate>
		<dc:creator>farrelley</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://www.kapustabrothers.com/?p=1226</guid>
		<description><![CDATA[Need filler content for your Zend Framework (ZF) application? Most clients never give the developer copy up front so it&#8217;s always hard show what the site is to look like without some random text. At the beginning of a new &#8230; <a href="http://www.kapustabrothers.com/2010/08/29/creating-filler-content-with-zend-framework/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Need filler content for your <a title="Zend Framework" href="http://framework.zend.com/">Zend Framework</a> (ZF) application?  Most clients never give the developer copy up front so it&#8217;s always hard show what the site is to look like without some random text.  At the beginning of a new application when you are mocking up the html and layout, I like to use static views.  I basically create a full static site with <a href="http://www.lipsum.com/">Lorem Ipsum</a> content.   I hated copying text over and over so I decided to create a quick view helper that will generate the content for you on the fly.  You can find the view helper on <a href="http://github.com/farrelley/Zend_View_Helpers/blob/master/library/Zend/View/Helper/LoremIpsum.php">github</a>.  Currently there are four different ways to generate the filler content.</p>
<ol>
<li>Paragraphs</li>
<li>Words</li>
<li>Bytes</li>
<li>and Lists</li>
</ol>
<p>You can find more information on optional parameters and how to use the view helper at <a href="http://github.com/farrelley/Zend_View_Helpers/blob/master/application/views/scripts/index/index.phtml">github</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kapustabrothers.com/2010/08/29/creating-filler-content-with-zend-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom Zend Filter: Excerpt</title>
		<link>http://www.kapustabrothers.com/2010/04/20/custom-zend-filter-excerpt/</link>
		<comments>http://www.kapustabrothers.com/2010/04/20/custom-zend-filter-excerpt/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 00:19:21 +0000</pubDate>
		<dc:creator>farrelley</dc:creator>
				<category><![CDATA[Web Development & Programming]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Excerpt]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Zend]]></category>
		<category><![CDATA[Zend_Filter]]></category>

		<guid isPermaLink="false">http://www.kapustabrothers.com/?p=1208</guid>
		<description><![CDATA[So you are familiar with the WordPress template tag called the_excert() right? If not the tag takes a post and trims it up to display 55 or so words and then adds ellipses to the end. I find this very &#8230; <a href="http://www.kapustabrothers.com/2010/04/20/custom-zend-filter-excerpt/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So you are familiar with the <a href="http://www.wordpress.com/">WordPress</a> template tag called <a href="http://codex.wordpress.org/Template_Tags/the_excerpt">the_excert()</a> right?  If not the tag takes a post and trims it up to display 55 or so words and then adds ellipses to the end.  I find this very useful when you just want to display a teaser.  In the current <a href="http://framework.zend.com/">Zend Framework</a> project then I am working on for a client I needed just this.  So I had to create the custom filter which is really easy.  You can find a vast amount of info for <a href="http://zendframework.com/manual/en/zend.filter.introduction.html">Zend Filters here</a>.  </p>
<p>Custom Filter &#8211; Excerpt</p>
<pre class="brush: php; title: ; notranslate">
// To call the filter use
$excerpt = new My_Filter_Excerpt();
$excerpt-&gt;filter($str); //$str is the string of text

//Put this in your library
class My_Filter_Excerpt implements Zend_Filter_Interface
{
	protected $_wordCount = 55;

	public function filter($data)
	{
		$sentance = explode(&quot; &quot;, $data);
		if (count($sentance) &amp;gt; $this-&amp;gt;_wordCount) {
			$sentance = array_splice($sentance, 0, $this-&amp;gt;_wordCount);
			$ellipsis = &quot;…&quot;;
		}
		$excerpt = implode(&quot; &quot;, $sentance);
		echo $excerpt . $ellipsis;
	}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.kapustabrothers.com/2010/04/20/custom-zend-filter-excerpt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gravatar Zend Framework View Helper</title>
		<link>http://www.kapustabrothers.com/2009/12/18/gravatar-zend-framework-view-helper/</link>
		<comments>http://www.kapustabrothers.com/2009/12/18/gravatar-zend-framework-view-helper/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 00:42:19 +0000</pubDate>
		<dc:creator>farrelley</dc:creator>
				<category><![CDATA[Web Development & Programming]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Automattic]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[Gravatar]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://www.kapustabrothers.com/?p=1172</guid>
		<description><![CDATA[I have worked on a Zend Framework these past couple of days and needed the ability to display a users avatar. This is easy by using Automattic&#8217;s gravatar project. The easiest way to add a users avatar is to use &#8230; <a href="http://www.kapustabrothers.com/2009/12/18/gravatar-zend-framework-view-helper/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have worked on a <a href="http://framework.zend.com/">Zend Framework</a> these past couple of days and needed the ability to display a users avatar.  This is easy by using <a href="http://www.automattic.com/">Automattic&#8217;s</a> <a href="http://en.gravatar.com/">gravatar project</a>.  The easiest way to add a users avatar is to use a (this) view helper.  Basically in your view you just pass the user&#8217;s email address and a desired size and your all set.  Make sure in the view helper you specify the default image if the user doesn&#8217;t have an avatar to display.</p>
<p><a href="http://kapustabrothers.com/code/Gravatar.php.txt">You can download the source here.</a>  Comments and improvements are always welcome.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
/**
 *
 * @author Shaun Farrell
 * @version 1.0
 */
require_once 'Zend/View/Interface.php';

/**
 * Gravatar helper
 *
 * @uses viewHelper Zend_View_Helper
 */
class Zend_View_Helper_Gravatar {

	/**
	 * @var Zend_View_Interface
	 */
	public $view;
	/**
	 *
	 * @var unknown_type
	 */
	protected $_gravatarUrl = &quot;http://www.gravatar.com/avatar.php?&quot;;
	/**
	 *
	 * @var unknown_type
	 */
	protected $_defaultImage = &quot;http://everquest.allakhazam.com/pgfx/item_576.png&quot;;

	/**
	 *
	 * @param $emailAddress
	 * @param $size
	 * @param $imgAlt
	 */
	public function gravatar($emailAddress, $size = &quot;40&quot;, $imgAlt = &quot;&quot;)
	{
		$gravatarId = &quot;gravatar_id=&quot; . md5(strtolower(trim($emailAddress)));
		$url = $this-&gt;_gravatarUrl . $gravatarId . &quot;&amp;default=&quot; . urlencode($this-&gt;_defaultImage) .
			&quot;&amp;size=&quot; . $size;

		echo &quot;&lt;img src=\&quot;$url\&quot; alt=\&quot;$imgAlt\&quot; /&gt;&quot;;
		return null;
	}

	/**
	 * Sets the view field
	 * @param $view Zend_View_Interface
	 */
	public function setView(Zend_View_Interface $view) {
		$this-&gt;view = $view;
	}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.kapustabrothers.com/2009/12/18/gravatar-zend-framework-view-helper/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Zend_Db Firebug Profiler via .ini File</title>
		<link>http://www.kapustabrothers.com/2009/08/03/zend_db-firebug-profiler-via-ini-file/</link>
		<comments>http://www.kapustabrothers.com/2009/08/03/zend_db-firebug-profiler-via-ini-file/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 16:59:48 +0000</pubDate>
		<dc:creator>farrelley</dc:creator>
				<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Firebug]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[FirePHP]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Profiler]]></category>
		<category><![CDATA[Zend]]></category>
		<category><![CDATA[Zend_DB]]></category>
		<category><![CDATA[ZF]]></category>

		<guid isPermaLink="false">http://www.kapustabrothers.com/?p=1145</guid>
		<description><![CDATA[So a couple of days ago I posted a way to get the DB profiler working via your bootstrap but an easier way to get things working is via your configuration .ini file. Once again you need Firefox, FireBug, and &#8230; <a href="http://www.kapustabrothers.com/2009/08/03/zend_db-firebug-profiler-via-ini-file/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So a couple of days ago I <a href="http://www.kapustabrothers.com/2009/07/31/getting-zend_db-firebug-profiler-working-with-zend_application/">posted a way to get the DB profiler working via your bootstrap</a> but an easier way to get things working is via your configuration .ini file.</p>
<p>Once again you need Firefox, FireBug, and FirePHP.  Then in your .ini file add the following lines;</p>
<pre class="brush: php; title: ; notranslate">
resources.db.isdefaulttableadapter = true
resources.db.params.profiler.enabled = true
resources.db.params.profiler.class = Zend_Db_Profiler_Firebug
</pre>
<p>The best part about this is that you can add this code only to load based on the environment set in your .htaccess or index.php file in your public folder.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kapustabrothers.com/2009/08/03/zend_db-firebug-profiler-via-ini-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Zend_Db Firebug Profiler Working with Zend_Application</title>
		<link>http://www.kapustabrothers.com/2009/07/31/getting-zend_db-firebug-profiler-working-with-zend_application/</link>
		<comments>http://www.kapustabrothers.com/2009/07/31/getting-zend_db-firebug-profiler-working-with-zend_application/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 19:14:56 +0000</pubDate>
		<dc:creator>farrelley</dc:creator>
				<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://www.kapustabrothers.com/?p=1134</guid>
		<description><![CDATA[When developing web applications I normally run into some SQL problems and want to see what the SQL code is doing on the backend. To do this one would normally just print the SQL statement to the screen during execution. &#8230; <a href="http://www.kapustabrothers.com/2009/07/31/getting-zend_db-firebug-profiler-working-with-zend_application/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When developing web applications I normally run into some SQL problems and want to see what the SQL code is doing on the backend.  To do this one would normally just print the SQL statement to the screen during execution.  However, if you use <a href="http://framework.zend.com/">Zend Framework</a> you are in luck.  You can profile your database calls with Firebug and it&#8217;s really easy.  Here is what you will need to start.</p>
<ol>
<li>Running Zend Framework (1.8.4 or above using Zend_Application)</li>
<li>Mozilla Firefox Browser &#8211; You should be using this anyways!</li>
<li>The latest version of Firebug &#8211; <a href="http://getfirebug.com/">http://getfirebug.com/</a></li>
<li>The lastest version of FirePHP &#8211; <a href="http://www.firephp.org/">http://www.firephp.org/</a></li>
</ol>
<p>Once those firefox add-ons have been installed your ready to add in some code.</p>
<p>In your bootstrap.php file add</p>
<pre class="brush: php; title: ; notranslate">
    /**
     * Setup the database profiling
     */
    protected function _initDbProfiler()
    {
        $this-&gt;bootstrap('db');
        $profiler = new Zend_Db_Profiler_Firebug('All DB Queries');
        $profiler-&gt;setEnabled(true);
        $this-&gt;getPluginResource('db')-&gt;getDbAdapter()
             -&gt;setProfiler($profiler);
    }
</pre>
<p>With this code added all your SQL statements that are executed will show up in the console window of FireBug.  <strong>If it&#8217;s not working make sure that you have the net console enabled!</strong>  profiling will not work if net is not enabled.</p>
<p>More information about Zend_Db_Profiler can be found at <a href="http://framework.zend.com/manual/en/zend.db.profiler.html">http://framework.zend.com/manual/en/zend.db.profiler.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kapustabrothers.com/2009/07/31/getting-zend_db-firebug-profiler-working-with-zend_application/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Surviving The Deep End: Chapter 3 Models</title>
		<link>http://www.kapustabrothers.com/2009/01/25/surviving-the-deep-end-chapter-3-models/</link>
		<comments>http://www.kapustabrothers.com/2009/01/25/surviving-the-deep-end-chapter-3-models/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 20:38:51 +0000</pubDate>
		<dc:creator>farrelley</dc:creator>
				<category><![CDATA[Books Reviews]]></category>
		<category><![CDATA[Zend]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Book]]></category>
		<category><![CDATA[Chapter 3]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Surviving the Deep End]]></category>

		<guid isPermaLink="false">http://www.kapustabrothers.com/?p=1112</guid>
		<description><![CDATA[Just got down reading chapter 3 of the free Zend Framework book called &#8220;Surviving The Deep End.&#8220;  Chapter 3 was about models and was very informative.  Many developers have different views on what the model should do. I am in &#8230; <a href="http://www.kapustabrothers.com/2009/01/25/surviving-the-deep-end-chapter-3-models/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Just got down reading <a href="http://www.survivethedeepend.com/zendframeworkbook/en/1.0/the.model">chapter 3</a> of the free <a href="http://framework.zend.com/">Zend Framework</a> book called &#8220;<a href="http://www.survivethedeepend.com/zendframeworkbook/en/1.0">Surviving The Deep End.</a>&#8220;  <a href="http://www.survivethedeepend.com/zendframeworkbook/en/1.0/the.model">Chapter 3</a> was about models and was very informative.  Many developers have different views on what the model should do.  I am in total agreement with this description of a model in the book.  I love the topic of &#8220;Skinny Controllers, Fat Models&#8221; Vs. the &#8220;Fat Stupid Ugly Controller.&#8221;  When developing, keep your controllers small and models big.  Models are the business logic, and the controller and views are part of the presentation layer (MVC).  Another thing I didn&#8217;t realize was in Zend Framework you can call the model from the view.  There is an example in Chapter 3 on why you would do this and it is very logical.  If the controller doesn&#8217;t use the data why push it through another layer?  There is no Data police!</p>
<p>Now its off to read Appendix A &#8220;<a href="http://www.survivethedeepend.com/zendframeworkbook/en/1.0/performance.optimisation.for.zend.framework.applications">Performance Optimisation For Zend Framework Applications</a>&#8221;</p>
<p>You can read my review of Chapter 1 &amp; 2 here.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kapustabrothers.com/2009/01/25/surviving-the-deep-end-chapter-3-models/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

