<?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>Web Development 2.0: Web Design, CakePHP, Javascript &#187; CakePHP</title>
	<atom:link href="http://www.webdevelopment2.com/category/cakephp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webdevelopment2.com</link>
	<description>Quick and Dirty Web Development for Web 2.0: CakePHP, Prototype, JQuery, and lots more.</description>
	<lastBuildDate>Sat, 23 Apr 2011 15:21:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Reader Input: Picking A CMS &#8211; Part 1</title>
		<link>http://www.webdevelopment2.com/picking-a-cms-part-1/</link>
		<comments>http://www.webdevelopment2.com/picking-a-cms-part-1/#comments</comments>
		<pubDate>Wed, 20 May 2009 15:09:28 +0000</pubDate>
		<dc:creator>Kevin Lloyd</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Reader Input]]></category>
		<category><![CDATA[cms]]></category>

		<guid isPermaLink="false">http://www.webdevelopment2.com/?p=510</guid>
		<description><![CDATA[In The Series Part 1 Part 2 Part 3 Part 4 Define The Problem In the past, I&#8217;ve done some freelance Web Development and Web Design for different clients. One question I&#8217;ve always had to ask myself is: How will the user be updating this website? That question is usually preempted by a question to [...]]]></description>
			<content:encoded><![CDATA[<h2>In The Series</h2>
<ul>
<li><a href="http://www.webdevelopment2.com/picking-a-cms-part-1/">Part 1</a></li>
<li><a href="http://www.webdevelopment2.com/picking-a-cms-2-new-standards/">Part 2</a></li>
<li><a href="http://www.webdevelopment2.com/picking-a-cms-3-wordpress-as-a-cms/">Part 3</a></li>
<li><a href="http://www.webdevelopment2.com/picking-cms-4-looking-at-drupal">Part 4</a></li>
</ul>
<h2>Define The Problem</h2>
<p>In the past, I&#8217;ve done some freelance Web Development and Web Design for different clients. One question I&#8217;ve always had to ask myself is:</p>
<blockquote><p>How will the user be updating this website?</p></blockquote>
<p>That question is usually preempted by a question to the client:</p>
<blockquote><p>Do you have any HTML experience?</p></blockquote>
<p>I can count (on one hand) the number of times that I&#8217;ve heard a <em>yes</em> to this question. To be quite honest, I don&#8217;t even know why I ask it anymore. <strong>Hardly any of my clients  ever had HTML experience</strong> and even if they did, I doubt they&#8217;d want to go through the hassle. So this poses the very interesting question How do you pick a <a title="Content Management System" href="http://en.wikipedia.org/wiki/Content_management_system">CMS</a> (content management system) for a web project?</p>
<h2>What Not To Do &#8211; Pure HTML is wrong for many reasons</h2>
<p><img class="size-full wp-image-267 alignnone" title="XHTML" src="http://www.webdevelopment2.com/wp-content/uploads/xhtml.jpg" alt="XHTML" width="450" height="191" />Over the years, I&#8217;ve had much experience in this area (what not to do). Gone are the days when people simply wanted a <em>web presence</em>. Those days, things were simple. You fire up your copy of Frontpage (oh how we&#8217;ve learned from then) and designed a website for a client and stick it onto an FTP server, and viola; you&#8217;re done. <strong>Worst case scenario</strong>, they call you up seven (7) months later and say they&#8217;ve <strong>changed their phone number and need you to make an update</strong>.</p>
<p>That might have been fine back then, but right now clients expect a lot more for their money. In this day and age when everyone is worried about SEO ranking and the phrase <a href="http://en.wikipedia.org/wiki/Web_content#Content_is_king">Content Is King</a> has been coined, <strong>no one wants to have to call you up (and God forbid; pay you) to make regular update</strong>s to their website. It is expected that you provide some sort method of updating their site.</p>
<p>With that said, providing a <strong>purely HTML solution is not user friendly and it can be down right dangerous</strong>. Do you really want to give your users full access to the HTML files that comprise the website? What if they <strong>break something in the layout</strong> while editing in Microsoft Word, ugh!. Who would be to blame? You would.</p>
<p>In the past I&#8217;ve guarded against this by using the PHP include strategy. The website would be primarily PHP with a folder called &#8220;content&#8221; sitting there with various HTML files. From there, I would pull any <em>dynamic content</em> that would be needed for the site: Page titles, tag lines, content blocks, etc, using standard PHP includes. This way my <strong>layout would stay (relatively) intact</strong> and the user would have access to change what they were allowed to change. The problem with this method is that they <strong>required some sort of HTML knowledge</strong> to modify the content files. They also <strong>required knowledge of FTP software</strong> and servers. Not to mention, that adding a pages or sections still needed heavy interaction from myself. Needless to say, I&#8217;ve grown from then.</p>
<h2>Joomla! &#8211; It looked like a good idea at first</h2>
<p><img class="size-medium wp-image-519 alignright" title="joomla" src="http://www.webdevelopment2.com/wp-content/uploads/joomla-300x190.png" alt="joomla" width="300" height="190" />Early in my college days, I stumbled across <a href="http://en.wikipedia.org/wiki/Mambo_(software)">Mambo</a> and subsequently <a href="http://en.wikipedia.org/wiki/Joomla!">Joomla!</a>, it&#8217;s current fork. It did so much for you, it had to be good, right? After installing Joomla for a client, I realized what the problem was. <strong>It just did too much</strong>. There were too many configurations, and simple things were just too hard. Also, last I remember, one of the main navigational structures was generated using and ugly and rigid table structure. Yes, I know it&#8217;s been changed by now, but that was part of my initial frustration.</p>
<p>It just felt too heavy for a normal website. No matter how much I restricted the user (by groups &#8211; editors as opposed to admins I think) I still <strong>got complaints about how complicated the backend interface it was</strong>. Added to that fact, the templates (and I stress) at that time were very cookie-cutter. It got to the point where I could eyeball a website built in Joomla.</p>
<p>Since then (over 3 years ago) I haven&#8217;t given Joomla a second look. It&#8217;s just one of those things that rubs you the wrong way once, and you never look back. Judging by the version numbers, I&#8217;m forced to assume that not much has changed. But that&#8217;s just an ignorant assumption with no basis, so please don&#8217;t hold it against me.</p>
<h2>More To Come</h2>
<p>I really had no idea this was going to be as long as it turned out. But sometimes I start ranting and never end. Hense, there shall be a part two where I talk about my dive into <a href="http://www.wordpress.org"  class="alinks_links" onclick="return alinks_click(this);" title=""  style="padding-right: 13px; background: url(http://www.webdevelopment2.com/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">WordPress</a>.</p>
<p>All user input is encouranged; ThanX</p>
Similar Posts:<ul><li><a href="http://www.webdevelopment2.com/picking-a-cms-3-wordpress-as-a-cms/" rel="bookmark" title="December 1, 2009">Reader Input: Picking A CMS – Part 3</a></li>

<li><a href="http://www.webdevelopment2.com/content-management-systems/" rel="bookmark" title="November 2, 2006">Content Management Systems</a></li>

<li><a href="http://www.webdevelopment2.com/spell-out-a-detailed-contract/" rel="bookmark" title="November 1, 2006">Spell Out a Detailed Contract</a></li>

<li><a href="http://www.webdevelopment2.com/nail-in-the-coffin-mamboservercom-hacked/" rel="bookmark" title="November 22, 2005">Nail in The Coffin &#8211; Mamboserver.com Hacked</a></li>

<li><a href="http://www.webdevelopment2.com/picking-a-cms-2-new-standards/" rel="bookmark" title="November 25, 2009">Reader Input: Picking A CMS – Part 2</a></li>
</ul><!-- Similar Posts took 4.101 ms -->]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopment2.com/picking-a-cms-part-1/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>A Bit On Open Source And Some Baz Background</title>
		<link>http://www.webdevelopment2.com/bit-open-source-baz-background/</link>
		<comments>http://www.webdevelopment2.com/bit-open-source-baz-background/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 13:03:17 +0000</pubDate>
		<dc:creator>Kevin Lloyd</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.webdevelopment2.com/?p=356</guid>
		<description><![CDATA[This has always been a touchy subject, especially in larger computer firms. But first, let me tell you how I got into Open Source. I started coding in Turbo Pascal 7.0, in about 1996 when I was in Grammar School. I took Turbo Pascal more as an introduction to Programming, instead of a product to [...]]]></description>
			<content:encoded><![CDATA[<p>This has always been a touchy subject, especially in larger computer firms. But first, let me tell you how I got into <a href="http://en.wikipedia.org/wiki/Open_source">Open Source</a>. I started coding in Turbo Pascal 7.0, in about 1996 when I was in Grammar School. I took Turbo Pascal more as an introduction to Programming, instead of a product to do something constructive in.</p>
<p>After Pascal, I was looking into something visual. Hence, I fell into Visual Basic 5.0. Yeah, I know, I&#8217;m sorry.</p>
<h3>Legal Issues</h3>
<p>Now this was my first step towards the open source community. I must admit, that I downloaded a pirated copy and ran with it for a while. Now, that was all well and good when I was sitting home playing around with stuff. But when it came to actually, to producing something for a market, you can&#8217;t (or should I say, shouldn&#8217;t) do that with pirated software.</p>
<p>After that, I got into web development. For this, there was a plethora of free tools available, for use. So I did that for a while. When I got back to college, I got into C++ (using Visual Studio, but still essentially free). That was a step in the right direction. However, as the semesters went on, we got more into using the .NET library. However, for my web development I never got into ASP.</p>
<h3>The First Real Plunge into Open Source &#8211; Enter PHP</h3>
<p>Bit by bit, web development gave way to web programming. This is where PHP came in. I got more familiar with PHP when I started working on different projects for clients. I chose PHP for a few main reasons:</p>
<ol>
<li><strong>Free Documentation:</strong> I could learn almost everything I needed through online documentation.</li>
<li><strong>Cost:</strong> My first problem was hosting. ASP hosts used to be almost twice as expensive as their Linux counterparts.</li>
</ol>
<h3>The Open Source Misconception</h3>
<p>One of the problems that people have with Open Source is that they think that it&#8217;s unsupported. People seem to think that open source software is written by a bunch of kids in basements or something. This is not the case, by any means.  For example, a lot of the Linux distributions are totally free and totally supported.  Wake up people; free doesn&#8217;t mean unsupported. The whole <em>&#8220;You get what you pay for&#8221;</em> isn&#8217;t always true.</p>
<h4>Why I Use Open Source Software</h4>
<p>For my personal web development, I run a very small team and we do work part time. This is no time to shell out $6,000 for a standard license of SQL Server 2005. MySQL server 5.0 is a very robust database server. It should be able to handle itself in a lot of the situations that people think they need to throw SQL Server at. Where, MySQL fails to deliver, PostgreSQL should be more than sufficient.</p>
<p>Open source software and products just make life easier. Take examples like, <a href="http://jquery.com/">jQuery</a> and <a href="http://www.cakephp.org/">CakePHP</a>. Would it be possible for an in-house team to come up with the same thing? Yes, sure? But why? Especially when a team (not just one guy) has put years into one special product. The price of the software does not dictate it&#8217;s quality.</p>
<h3>What Not To Do</h3>
<p>Now, one word of wisdom: All open source software isn&#8217;t the same. You need to do your research before diving into open source. Look up research about the product&#8217;s history, community support, and most importantly the support. If you run a very small shop, then almost anything will work for you; especially since you&#8217;re main goal would be to keep costs down.</p>
<p>However, a large company should not thumb their nose at open source software either. Unless you have a team dedicated to doing one task, and doing it well, why not utilise a tried and true method? Why do we always feel the need to reinvent the wheel? Seriously, your team may be extremely skilled, but can you guys really crank out a better Javascript Framework than <a href="http://www.JQuery.com"  class="alinks_links" onclick="return alinks_click(this);" title=""  style="padding-right: 13px; background: url(http://www.webdevelopment2.com/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">jQuery</a>? I doubt it.</p>
<p>Take a hint from one of the largest; Microsoft has recenlty started <a href="http://weblogs.asp.net/scottgu/archive/2008/09/28/jquery-and-microsoft.aspx">shipping jQuery</a> with their .NET 3.5 framework. They even have intellisense support for it in Visual Studio. Open source is the way of the future, as long as we learn to use it correctly.</p>
Similar Posts:<ul><li><a href="http://www.webdevelopment2.com/give-15-minutes-jquery-expert/" rel="bookmark" title="September 18, 2007">Give Me 15 Minutes and I&#8217;ll Make You A jQuery Expert</a></li>

<li><a href="http://www.webdevelopment2.com/nail-in-the-coffin-mamboservercom-hacked/" rel="bookmark" title="November 22, 2005">Nail in The Coffin &#8211; Mamboserver.com Hacked</a></li>

<li><a href="http://www.webdevelopment2.com/qa-with-joomla-development-leader/" rel="bookmark" title="November 1, 2005">Q&#038;A With Joomla Development Leader</a></li>

<li><a href="http://www.webdevelopment2.com/cakephp-ruby-rails-bias/" rel="bookmark" title="November 5, 2007">CakePHP vs. Ruby On Rails &#8211; A Very Bias Look at Why I Choose CakePHP</a></li>

<li><a href="http://www.webdevelopment2.com/new-domain-webdevelopment2com-new-focus-frameworks-cakephp-javascript-web-20/" rel="bookmark" title="August 22, 2007">New Domain: WebDevelopment2.com, New Focus: Frameworks, CakePHP, Javascript, Web 2.0</a></li>
</ul><!-- Similar Posts took 4.249 ms -->]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopment2.com/bit-open-source-baz-background/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CakePHP Contact Form &#8211; Quick and Dirty</title>
		<link>http://www.webdevelopment2.com/cakephp-contact-form-quick-dirty/</link>
		<comments>http://www.webdevelopment2.com/cakephp-contact-form-quick-dirty/#comments</comments>
		<pubDate>Fri, 07 Nov 2008 13:22:43 +0000</pubDate>
		<dc:creator>Kevin Lloyd</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[form]]></category>

		<guid isPermaLink="false">http://www.webdevelopment2.com/?p=343</guid>
		<description><![CDATA[I must say, this was a major hurdle for me when I first started out with CakePHP. If you&#8217;re working with some data from a database, then it&#8217;s all Model-View-Controller magic. Your forms are automatic: $form->input() is pretty much all you need. Why is this? That&#8217;s because all the information about the fields (names, sizes, [...]]]></description>
			<content:encoded><![CDATA[<p>I must say, this was a major hurdle for me when I first started out with CakePHP. If you&#8217;re working with some data from a database, then it&#8217;s all Model-View-Controller magic. Your forms are automatic: $form->input() is pretty much all you need. Why is this? That&#8217;s because all the information about the fields (names, sizes, types, etc.) come straight from the database.</p>
<h3>You&#8217;re Out On Your Own</h3>
<p>The problem right now is that, you&#8217;re all on your own. You need to describe your data on your own. So, on with it:</p>
<p>Here&#8217;s your model code:</p>
<pre class="brush: php; title: ;">
class Contact extends AppModel {
	var $name = 'Contact';
	var $useTable = false;  // Not using the database, of course.

	// All the fancy validation you could ever want.
	var $validate = array(
	    'name' =&gt; array(
	        'rule' =&gt; '/.+/',
			'allowEmpty' =&gt; false,
	        'required' =&gt; true,
	    ),
		'subject' =&gt; array(
	        'rule' =&gt; array('minLength', 5),
			'message' =&gt; 'Subject must be 5 characters long'
	    ),
		'email' =&gt; array(
	        'rule' =&gt; 'email',
			'message' =&gt; 'Please enter a valid email address'
	    ),
	);

	// This is where the magic happens
	function schema() {
		return array (
			'name' =&gt; array('type' =&gt; 'string', 'length' =&gt; 60),
			'email' =&gt; array('type' =&gt; 'string', 'length' =&gt; 60),
			'message' =&gt; array('type' =&gt; 'text', 'length' =&gt; 2000),
			'subject' =&gt; array('type' =&gt; 'string', 'length' =&gt; 100),
		);
	}
}
</pre>
<h3>What The User Sees</h3>
<p>I think the model&#8217;s the hardest part. The view is ridiculous:</p>
<pre class="brush: php; title: ;">
	echo $form-&gt;create(null, array('action' =&gt; 'index'));
	echo $form-&gt;input('name');
	echo $form-&gt;input('email');
	echo $form-&gt;input('subject');
	echo $form-&gt;input('message');
	echo $form-&gt;submit();
	echo $form-&gt;end();
</pre>
<p>I know; you&#8217;re disappointed right? Sorry.</p>
<h3>How Do We Control All This?</h3>
<p>So, here&#8217;s your controller. I was going to leave that up to you, but it&#8217;s so simple that I can&#8217;t help it:</p>
<pre class="brush: php; title: ;">
class ContactController extends AppController
{
	var $name = 'Contact';
	var $uses = 'Contact';
	var $helpers = array('Html', 'Form', 'Javascript');
	var $components = array('Email', 'Session');
	function index(){
		if(isset($this-&gt;data)) {
			$this-&gt;Contact-&gt;create($this-&gt;data);
			// There is no save(), so we need to validate manually.
			if($this-&gt;Contact-&gt;validates()){
				$this-&gt;Email-&gt;to = Configure::read('CONTACT_EMAIL');
				$this-&gt;Email-&gt;replyTo = $this-&gt;data['Contact']['email'];
				$this-&gt;Email-&gt;from = $this-&gt;data['Contact']['name'].' &lt;'.$this-&gt;data['Contact']['email'].'&gt;';
				$this-&gt;Email-&gt;subject = 'Contact Form: '.$this-&gt;data['Contact']['subject'];
				//$this-&gt;Email-&gt;delivery = 'debug';
				if ($this-&gt;Email-&gt;send($this-&gt;data['Contact']['message'])) {
					$this-&gt;Session-&gt;setFlash('Thank you for contacting us');
					//$this-&gt;redirect('/');
				} else {
					$this-&gt;Session-&gt;setFlash('Mail Not Sent');
				}
				$this-&gt;redirect(array('action' =&gt; 'index'));
			} else {
				$this-&gt;Session-&gt;setFlash('Please Correct Errors');
				//$this-&gt;redirect('/contacts');
			}
		}
	}
}
</pre>
<p>After I got halfway through this, I remembered that <a href="http://snook.ca/">Snook</a> had written <a href="http://snook.ca/archives/cakephp/contact_form_cakephp/">something very similar</a>, sorry J.</p>
<p>There&#8217;s one subtle difference that I&#8217;ve noticed, that I need to point out.<br />
<em>var $_schema</em> as apposed to <em>function schema()</em>. In the original CakePHP code, one of the major actions of <em>Model::function()</em> is to return <em>var Model::$_shema</em>. So, Tom-ay-to/Tom-a-to; it really doesn&#8217;t matter.</p>
Similar Posts:<ul><li><a href="http://www.webdevelopment2.com/cakephp-auth-component-tutorial-3/" rel="bookmark" title="April 9, 2008">CakePHP Auth Component &#8211; Will You Remember Me Tomorrow?</a></li>

<li><a href="http://www.webdevelopment2.com/stupid-cakephp-trick-day-generatelist-empty-slot/" rel="bookmark" title="November 1, 2007">Cute CakePHP Trick of the Day &#8211; GenerateList Empty Slot In List</a></li>

<li><a href="http://www.webdevelopment2.com/phpbb-2018-released/" rel="bookmark" title="October 30, 2005">phpBB 2.0.18 released</a></li>

<li><a href="http://www.webdevelopment2.com/cakephp-auth-component-tutorial-1/" rel="bookmark" title="January 8, 2008">CakePHP Auth Component For Dummies Tutorial</a></li>

<li><a href="http://www.webdevelopment2.com/8-reasons-html-emails-hurt-marketing/" rel="bookmark" title="October 31, 2006">8 Reasons HTML Emails Hurt Marketing</a></li>
</ul><!-- Similar Posts took 5.811 ms -->]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopment2.com/cakephp-contact-form-quick-dirty/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>CakePHP Auth Component &#8211; Tutorial Two</title>
		<link>http://www.webdevelopment2.com/cakephp-auth-component-tutorial-2/</link>
		<comments>http://www.webdevelopment2.com/cakephp-auth-component-tutorial-2/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 12:55:19 +0000</pubDate>
		<dc:creator>Kevin Lloyd</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[auth]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.webdevelopment2.com/cakephp-auth-component-tutorial-2/</guid>
		<description><![CDATA[This is the second installment of my Auth Component Tutorial. I included a link to download a file for during the first installment: Note: There is a file embedded within this post, please visit this post to download the file. I just think that some of the stuff in there warrants some explanation. isAuthorized() This [...]]]></description>
			<content:encoded><![CDATA[<p>This is the second installment of my <a href="http://www.webdevelopment2.com/cakephp-auth-component-tutorial-1/">Auth Component Tutorial</a>. I included a link to download a file for during the <a href="http://www.webdevelopment2.com/cakephp-auth-component-tutorial-1/">first installment</a>:</p>
Note: There is a file embedded within this post, please visit this post to download the file.
<p>I just think that some of the stuff in there warrants some explanation.</p>
<h3>isAuthorized()</h3>
<p>This function is needed when <strong>$this-Auth->authorize = &#8216;controller&#8217;</strong>. Theory has it, you can do something similar in app_model if <strong>$this-Auth->authorize = &#8216;model&#8217;</strong>, but I haven&#8217;t looked into this.</p>
<p>The thing that confused me about this is that I thought you were required to perform your own validation. But oh no, this is <em>additional</em> authorization. Sort of like what beforeSave() does, where you can <strong>cancel the save after the validation</strong>. isAuthorized() is performed <em>after</em> the user has been logged in. If after that, you need some additional stuff, then you can put it in there. I&#8217;m not sure why it doesn&#8217;t default to return true like beforeSave() (if everything goes well), but if it&#8217;s not present, it errors out.</p>
<h3>$this->Auth->user(&#8216;group_id&#8217;)</h3>
<p>In my User Model I have a field called <em>group_id.</em> So you guessed it, this just returns the <em>group_id</em> of the user that&#8217;s logged in. Things couldn&#8217;t be simpler.</p>
<h3>$this->Auth->userScope = array(&#8216;User.active&#8217; => 1)</h3>
<p>userScope is simply used as an added set of conditions and it behaves exactly the same way that <em>$conditions</em> works with the Model::find() function. So what I got about says that the user must be <em>active</em> to login.</p>
<p>So there you go. Happy Baking!</p>
<p>Get <a href="http://www.text-link-ads.com/starter_kit.php?ref=43330">$100 in FREE Links</a>.</p>
Similar Posts:<ul><li><a href="http://www.webdevelopment2.com/cakephp-auth-component-tutorial-1/" rel="bookmark" title="January 8, 2008">CakePHP Auth Component For Dummies Tutorial</a></li>

<li><a href="http://www.webdevelopment2.com/cakephp-auth-component-tutorial-3/" rel="bookmark" title="April 9, 2008">CakePHP Auth Component &#8211; Will You Remember Me Tomorrow?</a></li>

<li><a href="http://www.webdevelopment2.com/new-html-group-reinventing-html/" rel="bookmark" title="October 29, 2006">New HTML Group Reinventing HTML</a></li>

<li><a href="http://www.webdevelopment2.com/cakephp-bake-baking-models-controllers-views-cakephp-12/" rel="bookmark" title="November 21, 2007">CakePHP Bake &#8211; Baking Models, Controllers and Views the CakePHP 1.2 Way</a></li>

<li><a href="http://www.webdevelopment2.com/cakephp-12-beta-upgrade/" rel="bookmark" title="January 7, 2008">CakePHP 1.2 Beta Released Fresh Out of The Oven &#8211; Happy New Year</a></li>
</ul><!-- Similar Posts took 5.481 ms -->]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopment2.com/cakephp-auth-component-tutorial-2/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>CakePHP Auth Component For Dummies Tutorial</title>
		<link>http://www.webdevelopment2.com/cakephp-auth-component-tutorial-1/</link>
		<comments>http://www.webdevelopment2.com/cakephp-auth-component-tutorial-1/#comments</comments>
		<pubDate>Tue, 08 Jan 2008 12:35:24 +0000</pubDate>
		<dc:creator>Kevin Lloyd</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[auth]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.webdevelopment2.com/cakephp-auth-component-tutorial-1/</guid>
		<description><![CDATA[First off, I would like to say much thanks to Gwoo for finally helping me to understand this thing. So I know what you&#8217;re thinking; I&#8217;m probably the last person to finally figure out the CakePHP&#8217;s Auth Component. For the past few months, I&#8217;ve been using obAuth because that&#8217;s the only authentication I could get [...]]]></description>
			<content:encoded><![CDATA[<p>First off, I would like to say much thanks to Gwoo for finally helping me to understand this thing.</p>
<p>So I know what you&#8217;re thinking; I&#8217;m probably the last person to finally figure out the CakePHP&#8217;s Auth Component. For the past few months, I&#8217;ve been using <a href="http://bakery.cakephp.org/articles/view/obauth-component-tutorial">obAuth</a> because that&#8217;s the only authentication I could get to work with CakePHP. I think that I was just making it more difficult than it should have been.</p>
<p>My main resource for learning the Auth Component has been <a href="http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/">Chris&#8217;s tutorial</a>, but even then I still needed help. Also, I&#8217;m the type that doesn&#8217;t really learn much without code.</p>
<p>Note that I&#8217;m running off of the CaekPHP 1.2 beta.</p>
<h3>Getting Started</h3>
<p>Now you can modify this however you like, but I&#8217;m starting out with the basics. You&#8217;re going to need the following:</p>
<ul>
<li>A user database with fields <em>username</em>, <em>password</em>. Of course they don&#8217;t <em>need</em> to be named that way, but defaults are fun.</li>
<li>A User Model with Controller and Views &#8211; This can be baked from CakePHP</li>
<li>A login view for the user.</li>
<li>And a base app_controller.php. That&#8217;s it.</li>
</ul>
<h3>The Setup &#8211; app_controller and users_controller</h3>
<p>So here&#8217;s the minimum in app_controller:</p>
<pre class="brush: php; title: ;">
var $components = array('Auth');

function beforeFilter(){
	$this-&gt;Auth-&gt;loginAction = array('controller' =&gt; 'users', 'action' =&gt; 'login');
	$this-&gt;Auth-&gt;loginRedirect = array('controller' =&gt; 'pages', 'action' =&gt; 'display', 'home');
	$this-&gt;Auth-&gt;allow('display');
	$this-&gt;Auth-&gt;authorize = 'controller';
}
function isAuthorized() {
	return true;
}
</pre>
<p>You can always visit the <a href="http://api.cakephp.org/1.2/class_auth_component.html">API</a> for a better understanding of what&#8217;s going on, but right now we&#8217;re just trying to get stuff working.</p>
<p>After that there&#8217;s the users_controller.php. This you can get straight out of CakePHP&#8217;s baking. You do need a small modification:</p>
<pre class="brush: php; title: ;">
function login()
{
}

function logout(){
	$this-&gt;Session-&gt;setFlash('Logout');
	$this-&gt;redirect($this-&gt;Auth-&gt;logout());
}
</pre>
<h3>Brief Explanation</h3>
<p>Honestly, it&#8217;s magic; automagic to be precise. If you want to know how it works, you can read up in the <a href="http://api.cakephp.org/1.2/class_auth_component.html">API</a>. But what I will do, is give you some of the magic words.</p>
<h4>$this->Auth->authorize = &#8216;controller&#8217;</h4>
<p>There are different types of authorization action (ugh &#8211; ACL stuff), CRUD (basically locks up all the editing stuff), and controller (gives you some need control). Hey, sorry I don&#8217;t know too much of what it does, just what I need.</p>
<h4>$this->Auth->loginAction = array(&#8216;controller&#8217; => &#8216;users&#8217;, &#8216;action&#8217; => &#8216;login&#8217;)</h4>
<p>This tells yo what the login page is. It also controls where the user is redirected to if he&#8217;s not authorized to view a page.</p>
<h4>$this->Auth->loginRedirect = array(&#8216;controller&#8217; => &#8216;pages&#8217;, &#8216;display&#8217; => &#8216;home&#8217;)</h4>
<p>Self explanatory: default action to redirect the user to when logged in if they go straight to the login page. If, however, they tried to access a restricted page then this will be ignored and when they login they&#8217;ll be redirected to where they wanted to go to.</p>
<h4>$this->Auth->allow(array(&#8216;display&#8217;))</h4>
<p>This is one of the magic functions. By default, adding the authentication component locks down all actions, except the login and logout. This is your way of telling the component let me in to the &#8216;display&#8217; action for every controller. You at least want to see the homepage right?</p>
<p>You can also add to this in the <strong>beforeFilter()</strong> of each controller you you need (don&#8217;t forget the <em>parent::beforeFilter()</em> to make sure the Auth stuff is still called). Likewise there&#8217;s a <strong>$this->Auth->deny()</strong>, which does the reverse. One small tip: you can also use allow(array(&#8216;*&#8217;)) to allow everything.</p>
<h4>User Controller</h4>
<p>For right now, the login() action can be left as is. The Auth Component handles all that foot work beautifully. You just need to make sure you call $this->Auth->logout() in your logout() action. It has the added benefit of returning the <strong>Auth&#8217;s logoutRedirect</strong>, so <strong>$this->redirect($this->Auth->logout()</strong> works great.</p>
<p>There you have it, I hope that helps. Now if you&#8217;re still having a hard time, I got a present for you:</p>
Note: There is a file embedded within this post, please visit this post to download the file.
<p>There you&#8217;ll find some code, to get you up and running. It&#8217;s slightly different from what I got above (some extra stuff), but it&#8217;s heavily documented.</p>
<p>Enjoy and Happy Baking!
<p><small>Finally on DreamHost and Loving you <a href="http://www.webdevelopment2.com/go/dreamhost/">Dreamhost</a>. You should check them out!</small></p>
Similar Posts:<ul><li><a href="http://www.webdevelopment2.com/cakephp-auth-component-tutorial-3/" rel="bookmark" title="April 9, 2008">CakePHP Auth Component &#8211; Will You Remember Me Tomorrow?</a></li>

<li><a href="http://www.webdevelopment2.com/cakephp-auth-component-tutorial-2/" rel="bookmark" title="January 11, 2008">CakePHP Auth Component &#8211; Tutorial Two</a></li>

<li><a href="http://www.webdevelopment2.com/the-secret-of-cakephp-advanced-routing-even-better-urls/" rel="bookmark" title="September 6, 2007">The Secret of CakePHP Advanced Routing &#8211; Even Better URLs</a></li>

<li><a href="http://www.webdevelopment2.com/cakephp-contact-form-quick-dirty/" rel="bookmark" title="November 7, 2008">CakePHP Contact Form &#8211; Quick and Dirty</a></li>

<li><a href="http://www.webdevelopment2.com/cakephp-installation-guide-just-add-water-and-2-medium-eggs/" rel="bookmark" title="August 27, 2007">CakePHP Installation Guide: Just Add Water and 2 Medium Eggs</a></li>
</ul><!-- Similar Posts took 6.348 ms -->]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopment2.com/cakephp-auth-component-tutorial-1/feed/</wfw:commentRss>
		<slash:comments>41</slash:comments>
		</item>
		<item>
		<title>CakePHP 1.2 Beta Released Fresh Out of The Oven &#8211; Happy New Year</title>
		<link>http://www.webdevelopment2.com/cakephp-12-beta-upgrade/</link>
		<comments>http://www.webdevelopment2.com/cakephp-12-beta-upgrade/#comments</comments>
		<pubDate>Mon, 07 Jan 2008 12:28:11 +0000</pubDate>
		<dc:creator>Kevin Lloyd</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[bakery]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://www.webdevelopment2.com/cakephp-12-beta-upgrade/</guid>
		<description><![CDATA[So I guess the CakePHP development staff doesn&#8217;t take any holidays. Bright and early New Years Day 2008, we&#8217;re greeted with a fresh new release of CakePHP 1.2.6331 beta. No, not pre-beta a full blown beta. Needless to say I&#8217;m excited about this. There have been some nice changes which have gone through all through [...]]]></description>
			<content:encoded><![CDATA[<p>So I guess the CakePHP development staff doesn&#8217;t take any holidays. Bright and early New Years Day 2008, we&#8217;re greeted with a fresh new release of CakePHP 1.2.6331 beta. No, not pre-beta a full blown beta. Needless to say I&#8217;m excited about this.</p>
<p>There have been some nice changes which have gone through all through the Christmas season. Guys, I thank you for your dedication. The one major thing I&#8217;m excited about is the way that the Form Helper now processes dates and times; there&#8217;s no longer a cleanUpFields() function, everything is automatic (or should I say automagic). You&#8217;ll have modify your code since the result in $this-&gt;data is slightly different. There&#8217;s been some stuff deprecated and some stuff added.</p>
<p>The Model::generateList() function has also be deprecated, in favor of Model::find(&#8216;list&#8217;). It&#8217;s not an exact duplicate of generateList() but it gets the job done. Check out the <a href="http://cakebaker.42dh.com/" title="cakebaker">cakebaker</a> for more essential tips for <a href="http://cakebaker.42dh.com/2008/01/02/upgrading-from-cakephp-12-pre-beta-to-the-beta-version/" title="Upgrading from CakePHP 1.2 pre-beta to CakePHP 1.2 beta">upgrading from CakePHP 1.2 pre-beta to the fresh new CakePHP 1.2 beta</a>.</p>
<p>Enjoy and Happy Baking!
<p>Get <a href="http://www.text-link-ads.com/starter_kit.php?ref=43330">$100 in FREE Links</a>.</p>
Similar Posts:<ul><li><a href="http://www.webdevelopment2.com/cakephp-auth-component-tutorial-1/" rel="bookmark" title="January 8, 2008">CakePHP Auth Component For Dummies Tutorial</a></li>

<li><a href="http://www.webdevelopment2.com/stupid-cakephp-trick-day-generatelist-empty-slot/" rel="bookmark" title="November 1, 2007">Cute CakePHP Trick of the Day &#8211; GenerateList Empty Slot In List</a></li>

<li><a href="http://www.webdevelopment2.com/cakephp-auth-component-tutorial-2/" rel="bookmark" title="January 11, 2008">CakePHP Auth Component &#8211; Tutorial Two</a></li>

<li><a href="http://www.webdevelopment2.com/cakephp-contact-form-quick-dirty/" rel="bookmark" title="November 7, 2008">CakePHP Contact Form &#8211; Quick and Dirty</a></li>

<li><a href="http://www.webdevelopment2.com/enter-cakephp-rapid-development-framework-no-really/" rel="bookmark" title="July 2, 2007">Enter CakePHP &#8211; Rapid Development Framework &#8211; No Really!</a></li>
</ul><!-- Similar Posts took 4.060 ms -->]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopment2.com/cakephp-12-beta-upgrade/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CakePHP &#8211; One RSS Feed To Rule Them All</title>
		<link>http://www.webdevelopment2.com/cakephp-feed-rule/</link>
		<comments>http://www.webdevelopment2.com/cakephp-feed-rule/#comments</comments>
		<pubDate>Tue, 01 Jan 2008 12:33:48 +0000</pubDate>
		<dc:creator>Kevin Lloyd</dc:creator>
				<category><![CDATA[CakePHP]]></category>

		<guid isPermaLink="false">http://www.webdevelopment2.com/cakephp-feed-rule/</guid>
		<description><![CDATA[One problem that I&#8217;ve always had with finding CakePHP related information over the internet is the multiple sources. I wouldn&#8217;t so much mind if all these sources were legit. The thing that pisses me off is those scrapers who scrape the entire CakePHP mailing list. To me, there&#8217;s nothing worse than asking a question in [...]]]></description>
			<content:encoded><![CDATA[<p>One problem that I&#8217;ve always had with finding CakePHP related information over the internet is the multiple sources. I wouldn&#8217;t so much mind if all these sources were legit. The thing that pisses me off is those scrapers who scrape the entire CakePHP mailing list. To me, there&#8217;s nothing worse than asking a question in the mailing list, then searching on Google for an answer, just to find some idiot has scraped your question from the mailing list. I try to report them when I can, but I just can&#8217;t seem to keep up.</p>
<p>Sorry for the rant, back to my point. Sharan over on the CakePHP mailing list has made the process of finding the latest CakePHP information a lil&#8217; bit easier. Using Yahoo Pipes, he&#8217;s taken feeds the <strong>most popular CakePHP RSS feeds and consolidated them</strong> into <a href="http://feeds.feedburner.com/cakephp"><strong>one giant feed</strong> &#8211; http://feeds.feedburner.com/cakephp</a>. The great thing is that he&#8217;s also taken some of the non-english blog feeds and slapped on some translation. What more could you want?</p>
<p>I&#8217;m not sure how much the author values his privacy, so if you want to get in contact with him  and/or view the Yahoo Pipes source for this feed, head over to the CakePHP mailing list and search for: &#8220;http://pipes.yahoo.com/sharanbrar/cakephp&#8221;. If you think that their&#8217;s a blog missing, just leave a comment here and I&#8217;ll route it to the author.</p>
<p>Happy Baking!
<p>Get <a href="http://www.text-link-ads.com/starter_kit.php?ref=43330">$100 in FREE Links</a>.</p>
Similar Posts:<ul><li><a href="http://www.webdevelopment2.com/splogs-spam-blogs-from-mailing-lists-this-ones-new-to-me/" rel="bookmark" title="July 12, 2007">Splogs (Spam Blogs) From Mailing Lists &#8211; This One&#8217;s New To Me</a></li>

<li><a href="http://www.webdevelopment2.com/feedburner-google-search-cache-instant-blog-back-up/" rel="bookmark" title="May 10, 2007">FeedBurner + Google search cache =  Instant Blog Back Up</a></li>

<li><a href="http://www.webdevelopment2.com/stupid-cakephp-trick-day-generatelist-empty-slot/" rel="bookmark" title="November 1, 2007">Cute CakePHP Trick of the Day &#8211; GenerateList Empty Slot In List</a></li>

<li><a href="http://www.webdevelopment2.com/cakephp-12-beta-upgrade/" rel="bookmark" title="January 7, 2008">CakePHP 1.2 Beta Released Fresh Out of The Oven &#8211; Happy New Year</a></li>

<li><a href="http://www.webdevelopment2.com/web-development-20-carnival-september-24-2007/" rel="bookmark" title="September 24, 2007">Web Development 2.0 Carnival &#8211; September 24, 2007</a></li>
</ul><!-- Similar Posts took 4.059 ms -->]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopment2.com/cakephp-feed-rule/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Making Sure Your Javascript Doesn&#8217;t Rise When Baking</title>
		<link>http://www.webdevelopment2.com/making-javascript-rise-baking/</link>
		<comments>http://www.webdevelopment2.com/making-javascript-rise-baking/#comments</comments>
		<pubDate>Fri, 28 Dec 2007 18:57:39 +0000</pubDate>
		<dc:creator>Kevin Lloyd</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[bakery]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.webdevelopment2.com/making-javascript-rise-baking/</guid>
		<description><![CDATA[One of the nice things about CakePHP is that it includes ready to use CSS compression. Granted, compressed CSS can be buggy at times, but for the most part it works just fine. I&#8217;ve always wondered why no one has included something like this for Javascript, since that&#8217;s usually the bigger culprit when we&#8217;re talking [...]]]></description>
			<content:encoded><![CDATA[<p>One of the nice things about CakePHP is that it includes ready to use CSS compression. Granted, compressed CSS can be buggy at times, but for the most part it works just fine.</p>
<p>I&#8217;ve always wondered why no one has included something like this for Javascript, since that&#8217;s usually the bigger culprit when we&#8217;re talking about document size. I&#8217;ve tried using <a href="http://code.google.com/p/minify/" title="Minify Javascript">Minify</a> in the past. However, it took a lot to get it working right. And I really hate hacking stuff just to work with CakePHP. That, coupled with the fact that I&#8217;m a lazy bastard, meant that I gave up the Minify train rather quickly.</p>
<h3>Mark Story To The Rescue &#8211; JSMIN Javascript Helper</h3>
<p>At the time, I hadn&#8217;t heard about the <a href="http://code.google.com/p/jsmin-php/">JSMIN library</a>, which does pretty much the same thing the Minify does, but without the CSS. Luckily, Mr. Story had some vision after his Christmas festivities and cake up with a <a href="http://bakery.cakephp.org/articles/view/jsmin-helper-compress-and-cache-javascript" title="JSMin Helper Compress and cache javascript">JSMin Helper for CakePHP</a>. This helper works by Minifying the chosen Javascript. This involves stripping unnecessary characters (line breaks, comments, spaces, etc) from the .JS file.</p>
<p>It also includes functionality to <strong>cache the resulting files</strong>. What more can you ask for?</p>
<p><em>Usage:</em></p>
<pre class="brush: php; title: ;">
// Using the link:
echo $jsmin-&gt;link('myJS');
// Link with array of files:
echo $jsmin-&gt;link(array('file1', 'file2', 'file3'));
// Using a codeblock:
echo $jsmin-&gt;codeBlock(&quot;alert('javascript');&quot;);
</pre>
<p>The only slight caveat is that PHP 5.0 is required for the JSMin library, but who still runs PHP 4 anyway?</p>
<p>Mr. Mark, we thank you.</p>
Similar Posts:<ul><li><a href="http://www.webdevelopment2.com/cakephp-contact-form-quick-dirty/" rel="bookmark" title="November 7, 2008">CakePHP Contact Form &#8211; Quick and Dirty</a></li>

<li><a href="http://www.webdevelopment2.com/cakephp-auth-component-tutorial-3/" rel="bookmark" title="April 9, 2008">CakePHP Auth Component &#8211; Will You Remember Me Tomorrow?</a></li>

<li><a href="http://www.webdevelopment2.com/give-15-minutes-jquery-expert/" rel="bookmark" title="September 18, 2007">Give Me 15 Minutes and I&#8217;ll Make You A jQuery Expert</a></li>

<li><a href="http://www.webdevelopment2.com/stupid-cakephp-trick-day-generatelist-empty-slot/" rel="bookmark" title="November 1, 2007">Cute CakePHP Trick of the Day &#8211; GenerateList Empty Slot In List</a></li>

<li><a href="http://www.webdevelopment2.com/bindable-behavior-now-in-cakephp-core/" rel="bookmark" title="May 23, 2008">Bindable Behavior Now In CakePHP Core</a></li>
</ul><!-- Similar Posts took 4.528 ms -->]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopment2.com/making-javascript-rise-baking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using CakePHP for A School Project &#8211; Proof of Concept</title>
		<link>http://www.webdevelopment2.com/cakephp-school-project-proof-concept/</link>
		<comments>http://www.webdevelopment2.com/cakephp-school-project-proof-concept/#comments</comments>
		<pubDate>Fri, 30 Nov 2007 12:32:34 +0000</pubDate>
		<dc:creator>Kevin Lloyd</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[School]]></category>

		<guid isPermaLink="false">http://www.webdevelopment2.com/cakephp-school-project-proof-concept/</guid>
		<description><![CDATA[Before I start let me say that CakePHP is great. I love it to death. Currently, I&#8217;m coding a semester long class project for a friend. I&#8217;m trying to illustrate just how much faster it is to create a web application using CakePHP than anything else the other students are using. The Project The project [...]]]></description>
			<content:encoded><![CDATA[<p align="center"><a href="http://www.flickr.com/photos/robdup/71726001/" title="Prototype - Image By: robdup"><img src="http://www.webdevelopment2.com/wp-content/uploads/prototype.jpg" alt="Prototype: Image by robdup" border="0" height="379" width="504" /></a></p>
<p>Before I start let me say that CakePHP is great. I love it to death. Currently, I&#8217;m coding a semester long class project for a friend. I&#8217;m trying to illustrate just how much faster it is to create a web application using CakePHP than anything else the other students are using.</p>
<h3>The Project</h3>
<p>The project consists of computerizing some department of the local university. What she&#8217;s chosen is to computerize the Audio Visual Department. Specifically the process of submitting equipment requests to the department so they can take the equipment to different classes.</p>
<h3>The Competition</h3>
<p>The other students are using things like C#, Visual Basic, and other high level programming languages. With all these things, you need to design an interface (and everything else for that matter) from scratch.</p>
<p>You&#8217;re also on your own when it comes to controls and binding them to the database fields. Not to mention, you need to do all the database relationships by yourself. The other problem is that the project is a multi-user application by definition. That means a central database. This is generally more difficult to implement on a desktop application. The project, to me, just screams <strong>Web App!</strong></p>
<p>The good thing though, is that the database is the same no matter what the language.</p>
<h3>The Easy Button &#8211; Like Staples</h3>
<p>Enter CakePHP.</p>
<ul>
<li>Install CakePHP</li>
<li>Configure the database</li>
<li>Bake the models, controllers and views.</li>
<li>Modify the <em>Add</em> for the request so that it more closely fits the project description. This involves creating requests that span across a range of dates.</li>
</ul>
<p>Um, that&#8217;s it. Your done!</p>
<p>Right now, I&#8217;m working on making it <em>pretty</em>. The professors, so far, have seemed pretty impressed with the progress made in such a short amount of time. There&#8217;s even talk about being a guest speaker to introduce CakePHP to the class.</p>
<p>This just goes to show. You need something done <em>fast</em> CakePHP will get you there in no time.
<p>Get <a href="http://www.text-link-ads.com/starter_kit.php?ref=43330">$100 in FREE Links</a>.</p>
Similar Posts:<ul><li><a href="http://www.webdevelopment2.com/cakephp-bake-baking-models-controllers-views-cakephp-12/" rel="bookmark" title="November 21, 2007">CakePHP Bake &#8211; Baking Models, Controllers and Views the CakePHP 1.2 Way</a></li>

<li><a href="http://www.webdevelopment2.com/the-secret-of-cakephp-advanced-routing-even-better-urls/" rel="bookmark" title="September 6, 2007">The Secret of CakePHP Advanced Routing &#8211; Even Better URLs</a></li>

<li><a href="http://www.webdevelopment2.com/cakephp-installation-guide-just-add-water-and-2-medium-eggs/" rel="bookmark" title="August 27, 2007">CakePHP Installation Guide: Just Add Water and 2 Medium Eggs</a></li>

<li><a href="http://www.webdevelopment2.com/should-ajax-be-independent-of-the-server/" rel="bookmark" title="November 29, 2005">Should Ajax Be Independent of the Server?</a></li>

<li><a href="http://www.webdevelopment2.com/finally-moved-dreamhost-quality-web-hosting/" rel="bookmark" title="October 4, 2007">Finally We&#8217;ve Moved To DreamHost &#8211; Quality Web Hosting</a></li>
</ul><!-- Similar Posts took 4.352 ms -->]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopment2.com/cakephp-school-project-proof-concept/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WYBISYG &#8211; What You Bake Is What You Get &#8211; CakePHP + FCKEditor</title>
		<link>http://www.webdevelopment2.com/cakephp-fckeditor/</link>
		<comments>http://www.webdevelopment2.com/cakephp-fckeditor/#comments</comments>
		<pubDate>Fri, 23 Nov 2007 12:39:54 +0000</pubDate>
		<dc:creator>Kevin Lloyd</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.webdevelopment2.com/cakephp-fckeditor/</guid>
		<description><![CDATA[Now i doubt it has crossed anyone&#8217;s mind to use CakePHP to create a custom content management system (CMS). Even though you&#8217;re not designing a full blown CMS, sometimes it&#8217;s nice to give novice users a way to create HTML content for a website or web application. The simplest way to do this is to [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.webdevelopment2.com/wp-content/uploads/xhtml.jpg" alt="XHTML" class="imageframe" height="191" width="450" /><br />
Now i doubt it has crossed anyone&#8217;s mind to use CakePHP to create a custom content management system (CMS). Even though you&#8217;re not designing a full blown CMS, sometimes it&#8217;s nice to give novice users a way to create HTML content for a website or web application. The simplest way to do this is to integrate a WYSIWYG (What You See Is What You Get) editor.</p>
<p>When it comes to WYSIWYG editors, they are a dime a dozen. There is of course the world famous <a href="http://tinymce.moxiecode.com/">TinyMCE</a>. There is already an article in the bakery on how to use <a href="http://bakery.cakephp.org/articles/view/using-tinymce-with-cakephp">TinyMCE with CakePHP</a>. There&#8217;s <a href="http://www.htmlarea.com/">htmlArea</a> and even <a href="http://www.openwebware.com/products/openwysiwyg/demo.shtml">openWYSIWYG</a>.</p>
<p>Although I generally love TinyMCE, for my last project I needed to give the user the option to upload images. <a href="http://www.fckeditor.net/">FCKeditor</a> is the only editor that offers this functionality for free. Some say that it&#8217;s bloated, but you can always trim it down to only what you need. Actually the new (October 10th, 2007) version is pretty snazzy. They&#8217;ve done away with the font tag and just made it a lot cleaner.</p>
<h3>Dump It In And Configure</h3>
<p>Pretty simple. You download FCKeditor and dump it in the webroot/js folder. That&#8217;s it. How easy is that? If you want to get file and image uploads working, there&#8217;s a small configuration that you need to change.</p>
<ol>
<li>Find the following file: fckeditor\editor\filemanager\connectors\php\config.php</li>
<li>Set <em>$Config['Enabled']</em> to true.</li>
<li>Set <em>$Config['UserFilesPath']</em> to the path that you&#8217;re browsing to, relative to the root folder. If you&#8217;re going straight to the <em>images</em> folder, and not allowing users to browse elsewhere, this needs to be &#8216;/images&#8217;. This is what it uses to create the <em>src</em> and <em>href</em> attributes of your tags, so make sure they match what they should.</li>
<li>Most importantly, <em>$Config['UserFilesAbsolutePath']</em> needs to point to the absolute path. You could get away with not entering it, but then your URLs come out all funky.</li>
<li>Check the configurations at the bottom of the file to make sure they match what you want. For example, I usually change <em>$Config['FileTypesPath']['Image'] </em>to map to <em>images </em>instead of <em>image.</em></li>
</ol>
<h3>Set Up the Element</h3>
<p>Now there is an article in the bakery that talks about integrating <a href="http://bakery.cakephp.org/articles/view/using-fckeditor-with-cakephp">CakePHP with FCKeditor</a>. They use a fancy element that replaces only the textarea you want it to.</p>
<p>Well, this was written for CakePHP 1.1 and the modifications listed for CakePHP 1.2 doesn&#8217;t work for me. In any case, it&#8217;s not that important. I just use an element that replaces all TextAreas on the screen. Things are simpler that way <img src='http://www.webdevelopment2.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .</p>
<p>So here&#8217;s my element: fckeditor.ctp:</p>
<pre>
[JAVASCRIPT]
<script type="text/javascript">
	<!--
	function ReplaceAllTextareas() {
		// replace all of the textareas
		var allTextAreas = document.getElementsByTagName("textarea");
		for (var i=0; i < allTextAreas.length; i++) {
			var oFCKeditor = new FCKeditor( allTextAreas[i].name ) ;
			oFCKeditor.BasePath = "/js/fckeditor/" ;
			oFCKeditor.Height = 400;
			oFCKeditor.ReplaceTextarea() ;
		}
	}
	ReplaceAllTextareas();
	-->
</script>
[/JAVASCRIPT]</pre>
<p>I simply dump this right after my $form-&gt;end() or something like that. It doesn&#8217;t really matter.</p>
<p>An there you have it. CakePHP and FCKEditor. Have fun with it.</p>
Similar Posts:<ul><li><a href="http://www.webdevelopment2.com/optmize-images-for-the-web/" rel="bookmark" title="November 18, 2006">Optmize Images for the Web</a></li>

<li><a href="http://www.webdevelopment2.com/html-php-etc-code-editor/" rel="bookmark" title="November 19, 2005">HTML, PHP, etc Code Editor</a></li>

<li><a href="http://www.webdevelopment2.com/lightbox-lightbox2-and-lightbox-plus/" rel="bookmark" title="December 12, 2006">LightBox, LightBox2 and LightBox Plus</a></li>

<li><a href="http://www.webdevelopment2.com/cakephp-bakery-yeast/" rel="bookmark" title="November 6, 2007">The CakePHP Bakery Is Out Of Yeast</a></li>

<li><a href="http://www.webdevelopment2.com/top-10-css-image-galleries-diy/" rel="bookmark" title="November 27, 2006">Top 10 CSS Image Galleries &#8211; DIY</a></li>
</ul><!-- Similar Posts took 4.910 ms -->]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopment2.com/cakephp-fckeditor/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>CakePHP Bake &#8211; Baking Models, Controllers and Views the CakePHP 1.2 Way</title>
		<link>http://www.webdevelopment2.com/cakephp-bake-baking-models-controllers-views-cakephp-12/</link>
		<comments>http://www.webdevelopment2.com/cakephp-bake-baking-models-controllers-views-cakephp-12/#comments</comments>
		<pubDate>Wed, 21 Nov 2007 12:01:18 +0000</pubDate>
		<dc:creator>Kevin Lloyd</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[bake]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.webdevelopment2.com/cakephp-bake-baking-models-controllers-views-cakephp-12/</guid>
		<description><![CDATA[Patty Cake, Patty Cake, Baker&#8217;s Man One of the things that sold me on CakePHP is the bake routine. This is basically code generation for the lazy types like myself. It was good in CakePHP version 1.1, now it&#8217;s just awesome. The only way they can make it better is to implement a web version, [...]]]></description>
			<content:encoded><![CDATA[<p><img class="imageframe" src="http://www.webdevelopment2.com/wp-content/uploads/oven-knob2.jpg" alt="Oven Knob" width="500" height="375" /></p>
<h3>Patty Cake, Patty Cake, Baker&#8217;s Man</h3>
<p>One of the things that sold me on CakePHP is the <em>bake</em> routine. This is basically code generation for the lazy types like myself. It was good in CakePHP version 1.1, now it&#8217;s just awesome. The only way they can make it better is to implement a web version, but that&#8217;s another story.</p>
<h3>What Baking Does</h3>
<p>In CakePHP we refer to the automatic code generation as <em>baking</em> (get it now?). An entire application can be baked from nothing more than a few tables in a database. CakePHP uses some skeleton templates, which you can of course customize to your needs, to generate your Models, Views and Controllers. The controllers and views come with the standard CRUD (create, read, update, and delete) functions and can also contain admin functions.</p>
<p>Currently, we run the Bake routine from the command line. I&#8217;m hoping sooner or later this can change, but with a lot of hosts allowing shell access to your account, this isn&#8217;t a priority with the developers.</p>
<h3>Setting Up In Windows</h3>
<p>Although this is not necessary, one thing I like to do is add both <em>bake</em> and the <em>PHP</em> executable to my path. To do this, we go to the Windows <em>System Properties</em> dialog, then the <em>Advanced</em> tab, and click on <em>Environment Variables</em>.<br />
<img class="imageframe" src="http://www.webdevelopment2.com/wp-content/uploads/system-variables.png" alt="Setting PATH in Windows" width="384" height="585" align="left" /><br />
You find the <em>Path</em> system variable and add your PHP (D:\wamp\php;) and cake console (D:\wamp\www\cake\cake\console) paths, separated by semicolons.</p>
<p>Linux users, you haven&#8217;t <a href="http://www.troubleshooters.com/linux/prepostpath.htm">Been forgotten</a>.</p>
<h3>Preheat the Oven</h3>
<p>When I bake, I like to bake from scratch, so to speak. Let&#8217;s assume we&#8217;re creating a fresh new application called <em>baz</em>. You go to CakePHP main folder and type the following on the command line:</p>
<blockquote><p><code>cake bake baz</code></p></blockquote>
<p>and follow the prompts.<br />
This will generate a new application folder called <em>baz</em> ready for use. After this, you would go to the application folder and set up your configurations; core.php, database.php, etc. One thing about baking an application from scratch is that it bakes the application with a new, random Security Salt variable. Pretty cool huh?</p>
<p>You could even bake your database configuration for the database.php file, but let&#8217;s keep not get carried away here.</p>
<h3>Baking Models</h3>
<p>This is the most important part of baking, the model. Because CakePHP draws all its power from from conventions, it is extremely important that your database follow the CakePHP conventions. This means table names, field names, foreign key names, plurals, etc. Head to the folder for the application: (D:\wamp\www\cake\baz) and type in:</p>
<blockquote><p><code>cake bake</code></p></blockquote>
<p>You could also skip the first prompt and bake the model directly:</p>
<blockquote><p><code>cake bake model [model name]</code></p></blockquote>
<p>Follow the prompts, bake a model, etc. At every step, you&#8217;ll be prompted for various aspects of your model. It asks you what type of validation you want for each field for the model. If your database is set up correctly, the <em>bake</em> routine can even detect your database associations and build them accordingly. For example, while baking the <em>Users</em> model, if you have a table, <em>users</em> that contains a field <em>group_id</em>, the routine will ask if the model &#8220;hasOne Group&#8221;. Say no, and it will ask if the model &#8220;hasMany Groups&#8221;. It doesn&#8217;t get easier than this.</p>
<h3>Baking Controllers</h3>
<p>You can go through all the prompts, but in my opinion this takes too much time for me. Here are some <em>straight to the point</em> commands to get you on your way:</p>
<blockquote><p><code>cake bake controller Users</code></p></blockquote>
<p>This bakes an empty controller using scaffolding. If you don&#8217;t know, <a href="http://manual.cakephp.org/chapter/scaffolding">Scaffolding</a> is sort of like baking, except with no functions and no views. This is usually used to test of database schema, model association, model validation, etc.</p>
<blockquote><p><code>cake bake controller Users scaffold</code></p></blockquote>
<p>This does the same thing as the command above, except it actually creates the functions: index, add, view, edit, and delete.</p>
<blockquote><p><code>cake bake controller Users scaffold admin</code></p></blockquote>
<p>Again, this does the same thing as the top, but with admin_index, admin_add, admin_view, admin_edit and admin_delete functions. Starting to get the picture?</p>
<h3>Baking Views</h3>
<p>This couldn&#8217;t be simpler:</p>
<blockquote><p><code>cake bake view Users</code></p></blockquote>
<p>Creates views for all the functions created in the Users controller.</p>
<p>Now you could of course just use the basic <em>bake</em> routine and follow the prompts for every aspect of building, but I&#8217;ve found that this wastes too much time; especially with the controllers and views. You only need to pay attention for the model.</p>
<p>Bake applications has become priceless for me when trying to do a proof of concept of a new application for a client.</p>
<p>Source: <a href="http://cakebaker.42dh.com/tags/bake/">CakePHP Baking</a> [CakeBaker]
<p>Get <a href="http://www.text-link-ads.com/starter_kit.php?ref=43330">$100 in FREE Links</a>.</p>
Similar Posts:<ul><li><a href="http://www.webdevelopment2.com/the-secret-of-cakephp-advanced-routing-even-better-urls/" rel="bookmark" title="September 6, 2007">The Secret of CakePHP Advanced Routing &#8211; Even Better URLs</a></li>

<li><a href="http://www.webdevelopment2.com/quick-multiple-local-roots-wamp/" rel="bookmark" title="November 16, 2007">Here&#8217;s a Quick Way to Use Multiple Local Roots With WAMP</a></li>

<li><a href="http://www.webdevelopment2.com/cakephp-auth-component-tutorial-1/" rel="bookmark" title="January 8, 2008">CakePHP Auth Component For Dummies Tutorial</a></li>

<li><a href="http://www.webdevelopment2.com/cakephp-installation-guide-just-add-water-and-2-medium-eggs/" rel="bookmark" title="August 27, 2007">CakePHP Installation Guide: Just Add Water and 2 Medium Eggs</a></li>

<li><a href="http://www.webdevelopment2.com/cakephp-school-project-proof-concept/" rel="bookmark" title="November 30, 2007">Using CakePHP for A School Project &#8211; Proof of Concept</a></li>
</ul><!-- Similar Posts took 4.629 ms -->]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopment2.com/cakephp-bake-baking-models-controllers-views-cakephp-12/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>The CakePHP Bakery Is Out Of Yeast</title>
		<link>http://www.webdevelopment2.com/cakephp-bakery-yeast/</link>
		<comments>http://www.webdevelopment2.com/cakephp-bakery-yeast/#comments</comments>
		<pubDate>Tue, 06 Nov 2007 13:42:06 +0000</pubDate>
		<dc:creator>Kevin Lloyd</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[bakery]]></category>

		<guid isPermaLink="false">http://www.webdevelopment2.com/cakephp-bakery-yeast/</guid>
		<description><![CDATA[Today I popped onto the CakePHP Bakery looking for the obAuth Component. To my surprise, I got a blank page. Seems like there&#8217;s a database issue. Here&#8217;s hoping that it&#8217;s not down for too long. Update (11/20/07): Most of the stuff is back up on the bakery. The rating is still a small issue, but [...]]]></description>
			<content:encoded><![CDATA[<p> <a href="http://www.webdevelopment2.com/wp-content/uploads/bakery-down.png" rel="lightbox[pics-1194355910]" title="CakePHP Bakery Down"><img src="http://www.webdevelopment2.com/wp-content/uploads/bakery-down.thumbnail.png" alt="CakePHP Bakery Down" class="imageframe" height="166" width="450" /></a><br />
Today I popped onto the <a href="http://bakery.cakephp.org/">CakePHP Bakery</a> looking for the <a href="http://bakery.cakephp.org/articles/view/obauth-simple-authentication">obAuth Component</a>. To my surprise, I got a blank page.</p>
<p>Seems like there&#8217;s a database issue. Here&#8217;s hoping that it&#8217;s not down for too long.</p>
<p><em>Update (11/20/07):</em></p>
<p>Most of the stuff is back up on the bakery. The rating is still a small issue, but all the code and tutorials are up and running.</p>
<p>Bake On!
<p><small>Finally on DreamHost and Loving you <a href="http://www.webdevelopment2.com/go/dreamhost/">Dreamhost</a>. You should check them out!</small></p>
Similar Posts:<ul><li><a href="http://www.webdevelopment2.com/cakephp-auth-component-tutorial-1/" rel="bookmark" title="January 8, 2008">CakePHP Auth Component For Dummies Tutorial</a></li>

<li><a href="http://www.webdevelopment2.com/give-15-minutes-jquery-expert/" rel="bookmark" title="September 18, 2007">Give Me 15 Minutes and I&#8217;ll Make You A jQuery Expert</a></li>

<li><a href="http://www.webdevelopment2.com/cakephp-bake-baking-models-controllers-views-cakephp-12/" rel="bookmark" title="November 21, 2007">CakePHP Bake &#8211; Baking Models, Controllers and Views the CakePHP 1.2 Way</a></li>

<li><a href="http://www.webdevelopment2.com/finally-moved-dreamhost-quality-web-hosting/" rel="bookmark" title="October 4, 2007">Finally We&#8217;ve Moved To DreamHost &#8211; Quality Web Hosting</a></li>

<li><a href="http://www.webdevelopment2.com/poll-results-php-framework/" rel="bookmark" title="November 28, 2007">Poll Results &#8211; What Do You Look for in a PHP Framework?</a></li>
</ul><!-- Similar Posts took 4.162 ms -->]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopment2.com/cakephp-bakery-yeast/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CakePHP vs. Ruby On Rails &#8211; A Very Bias Look at Why I Choose CakePHP</title>
		<link>http://www.webdevelopment2.com/cakephp-ruby-rails-bias/</link>
		<comments>http://www.webdevelopment2.com/cakephp-ruby-rails-bias/#comments</comments>
		<pubDate>Mon, 05 Nov 2007 12:29:22 +0000</pubDate>
		<dc:creator>Kevin Lloyd</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Fast CGI]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://www.webdevelopment2.com/cakephp-ruby-rails-bias/</guid>
		<description><![CDATA[First of let me state that this post is very bias towards CakePHP. Truth be told, I haven&#8217;t even installed or used Ruby on Rails. The closest I&#8217;ve come is looking at various code snippets I&#8217;ve found around. With that said, you may want to stop reading now. These arguments are not based on hard [...]]]></description>
			<content:encoded><![CDATA[<p>First of let me state that this post is very bias towards CakePHP. Truth be told, I haven&#8217;t even installed or used Ruby on Rails. The closest I&#8217;ve come is looking at various code snippets I&#8217;ve found around. With that said, you may want to stop reading now.</p>
<p>These arguments are not based on hard facts, since I haven&#8217;t done much research on the matter. A lot of them come from a post at <a href="http://blog.clickablebliss.com/">Clickable Bliss</a> discussing the <a href="http://blog.clickablebliss.com/2005/12/27/php-vs-ruby-on-rails-part-3/">PHP vs. Ruby On Rails Issue</a>.</p>
<ol>
<li>
<h3>Steep Learning Curve &#8211; Laziness</h3>
<p>One thing I really hate is learning stuff. It is especially bothersome when you&#8217;re trying to crank out a project or web application in a limited amount of time.</p>
<p>With CakePHP I&#8217;m required to learn about the <strong>MVC style of development</strong> as well as CakePHP <strong>conventions</strong>.</p>
<p>With Ruby on Rails, I would have to learn MVC, Ruby on Rails conventions and I would have to s<strong>tart from scratch with the Ruby programming language</strong> as well.</p>
<p>A lot of developers adopt the <em>Programming Is Programming</em> philosophy. They say that coding concepts are standard across the board; <em>You&#8217;ve seen one language, you&#8217;ve seem em&#8217; all!</em></p>
<p>That may be true in general, but there was no way I was going to learn an entirely new language on the eve of project development. I&#8217;ve been meddling with PHP on and off for years now, so I feel more comfortable in the environment.</li>
<li>
<h3>Setup and Deployment &#8211; More Laziness</h3>
<p>With CakePHP, I know I could boot up my PC download and install WAMP and be done with it. If I wasn&#8217;t home and only had my USB Disk, XAMPP Lite would serve just as well. I dump the CakePHP code into a folder, tweak my config file and I&#8217;m good to go.</p>
<p>With RoR, the preferred method is downloading and installing Ruby, then installing MySQL, then installing Rails, then configuring with your web server (if you have one). You could also go the LAMP route with <a href="http://wiki.rubyonrails.org/rails/pages/InstantRails">InstantRails</a>, but this is less flexible.</p>
<p>Deploying to customers is usually a breeze. Change the config file to point to a different database, maybe change some .htaccess files, then copy and paste. It doesn&#8217;t get much simpler. With RoR, who knows what&#8217;s involved?</li>
<li>
<h3>Shared Host Support &#8211; I&#8217;m Just Cheap Like That</h3>
<p>This, by far, was my major turn off to Ruby On Rails. When it first hit the scene, <strong>none of the hosts that I used supported RoR</strong>. Back in the day, you would need a dedicated server to use RoR effectively.</p>
<p>This wasn&#8217;t going to fly for me. I don&#8217;t do Web Development for my health or for fun. <strong>I design web applications for clients</strong>. A lot of my work involves <em>redesign</em> of already existing sites. How do I say to a client: <em>Hey, although your current web host that you&#8217;ve prepaid a year for is sufficient for 90% or the stuff you can throw at it, I&#8217;m using this new technology and you need to shell out some more $$$ for a host that can handle it.</em></p>
<p>PHP hosts are a dime a dozen. 98% (again not a hard fact, but an educated guess) of hosts that you pay for will offer at least PHP 4. Although more and more shared hosts, like <a href="http://www.webdevelopment2.com/go/dreamhost/"  class="alinks_links" onclick="return alinks_click(this);" title="DreamHost - Quality Web Hosting"  style="padding-right: 13px; background: url(http://www.webdevelopment2.com/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">Dreamhost</a>, are supporting Ruby on Rails, they were quite scarce back when I had to make my choice of frameworks.</li>
<li>
<h3>Speed</h3>
<p>This is going to be a touchy subject. But let me just blurt out what I&#8217;ve read: <strong>Ruby on Rails is inherently slow</strong>. There, I said it. It&#8217;s not its fault, it was created that way by design.</p>
<p><strong>Because everything in RoR is an object, it has to be instantiated</strong>, which takes up CPU time and memory. Even empty objects. With PHP and empty array is a memory address, that&#8217;s it. Although CakePHP does support OOP using PHP5, most of <strong>CakePHP&#8217;s data manipulation is still heavily array based</strong>.</p>
<p>There are steps you can take to speed up RoR. Running it <strong>using Fast CGI</strong> is one option. But again we get to the point of what is a available on shared hosts. Even on dedicated hosts performance is a problem. <strong>The RoR community has taken the <em>Throw More Hardware At It</em> defense</strong>, but everyone doesn&#8217;t have that options. They are quite vested in <a href="http://en.wikipedia.org/wiki/Moore's_law">Moore&#8217;s Law</a>, which basically states that hardware performance will continue to increase exponentially, due to increases in technology.</p>
<p>Even one of the developers of Twitter (huge RoR application) has expressed <a href="http://www.radicalbehavior.com/5-question-interview-with-twitter-developer-alex-payne/">concern about RoR&#8217;s performance</a>. For the rest of us of us on shared hosts or who write small/medium sized applications for clients on shared hosts, <strong>Fast CGI</strong> (if not already installed) and <strong>adding a faster CPU are luxuries that we simply do not have</strong>. I would also remind you that even Mr. Moore himself stated that the law <em>&#8220;can&#8217;t continue forever&#8221;</em>. There&#8217;s going to be a point when things get down the atomic sizes, then what? But anyway, that&#8217;s a whole other discussion.</p>
<p>My point is, I write efficient code when I can. Other times I write &#8220;get it done&#8221; code. <strong>I can&#8217;t afford to my framework to slow me down</strong> even more than I&#8217;m going slow down myself. With these memory and CPU issues, I even wonder how shared hosts are able to provide RoR services to all their customers.</li>
<li>
<h3>Object Oriented Programming</h3>
<p>Rails is all about OOP, from head to toe. Most times, that&#8217;s a good thing.</p>
<p>There&#8217;s not much to say about this in CakePHP&#8217;s defense. Because the decision was made to support PHP4, the full power of OOP cannot be exploited. However, there are a few things to keep in mind. <strong>PHP4 development is officially dead</strong>, PHP6 is around the corner, and<strong> CakePHP is still at version 1</strong>. The future holds exponential growth for CakePHP.</p>
<p>Me personally, I don&#8217;t really care. CakePHP gets the job done for me, that&#8217;s all I ask.</li>
<li>
<h3>Documentation</h3>
<p>Fair is fair. Here, I concede. Rails has some great online documentation and even a great book out there.</p>
<p>The CakePHP community lacks documentation in a major way. One of the major reasons for this is that the project is still growing so rapidly that documentation would actually hurt for two reasons: <strong>It would slow down the developers and in five (5) months it might be obsolete</strong>. Right now, we are left to hunt and peck through the API to determine how to do things or ask around in the <a href="http://groups.google.com/group/cake-php">CakePHP Group</a>.</p>
<p>As development slows down a big, the documentation will evolve. I&#8217;m gonna go out on a limb here and predict that by CakePHP 1.5, we should have some solid documentation out there. By version 2.0 we should have a book.</li>
</ol>
<p>It&#8217;s important to note that when it comes to decisions like these, I am in no way loyal (Sorry guys). I usually vote for whatever is going to create less work for me. So far, CakePHP has been leading the forefront in &#8220;Making Less Work For Baz&#8221; so it&#8217;s two thumbs up.
<p><small>Finally on DreamHost and Loving you <a href="http://www.webdevelopment2.com/go/dreamhost/">Dreamhost</a>. You should check them out!</small></p>
Similar Posts:<ul><li><a href="http://www.webdevelopment2.com/understand-bias-means/" rel="bookmark" title="April 16, 2008">Do We Not Understand What Bias Means?</a></li>

<li><a href="http://www.webdevelopment2.com/the-top-five-technologies-you-need-to-know-about-in-2007/" rel="bookmark" title="March 4, 2007">The Top Five Technologies You Need to Know About In 2007</a></li>

<li><a href="http://www.webdevelopment2.com/simple-mysql-database-backup/" rel="bookmark" title="October 31, 2006">Simple MySQL Database Backup</a></li>

<li><a href="http://www.webdevelopment2.com/enter-cakephp-rapid-development-framework-no-really/" rel="bookmark" title="July 2, 2007">Enter CakePHP &#8211; Rapid Development Framework &#8211; No Really!</a></li>

<li><a href="http://www.webdevelopment2.com/twitter-bite-php-bullet/" rel="bookmark" title="May 3, 2008">Twitter to Bite the PHP Bullet?</a></li>
</ul><!-- Similar Posts took 5.563 ms -->]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopment2.com/cakephp-ruby-rails-bias/feed/</wfw:commentRss>
		<slash:comments>36</slash:comments>
		</item>
		<item>
		<title>Cute CakePHP Trick of the Day &#8211; GenerateList Empty Slot In List</title>
		<link>http://www.webdevelopment2.com/stupid-cakephp-trick-day-generatelist-empty-slot/</link>
		<comments>http://www.webdevelopment2.com/stupid-cakephp-trick-day-generatelist-empty-slot/#comments</comments>
		<pubDate>Thu, 01 Nov 2007 12:11:43 +0000</pubDate>
		<dc:creator>Kevin Lloyd</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.webdevelopment2.com/stupid-cakephp-trick-day-generatelist-empty-slot/</guid>
		<description><![CDATA[With this post I&#8217;m introducing a new segment to this blog: Cute CakePHP Trick of the Day. This is basically going to be a learn as I learn sort of thing. There are always a bunch of little things that I want to do in CakePHP, but just haven&#8217;t figured out. So every time I [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.webdevelopment2.com/wp-content/uploads/list.jpg" alt="List" class="imageframe" height="302" width="550" /></p>
<p>With this post I&#8217;m introducing a new segment to this blog: <em>Cute CakePHP Trick of the Day.</em></p>
<p>This is basically going to be a <em>learn as I learn</em> sort of thing. There are always a bunch of little things that I want to do in CakePHP, but just haven&#8217;t figured out. So every time I stumble onto something, I&#8217;ll let you guys in on it.</p>
<p>I love the GenerateList() function. This is generally used when you have models with associations with other models. The GenerateList function is often used in these cases to populate a drop down list or a multiple select list. A typical example is a <em>state</em> drop down on an address form.</p>
<p>One <em>problem</em> that I have with this implementation is that it always produces a complete list and there is no <em>empty</em> slot. There is nothing to say that <em>I don&#8217;t want to associate anything for this entry</em>. On a drop down list, it&#8217;s impossible not to select an element. On a multiple selection list, even if the user holds <em>CTRL</em> and clicks to unselect the current entry, CakePHP ignores this entry.</p>
<p>Here&#8217;s the fix. Assuming in your controller you have something like:</p>
<pre class="brush: php; title: ;">$this-&gt;;State-&gt;generateList();</pre>
<p>and in the view:</p>
<pre class="brush: php; title: ;">echo form-&gt;input(state_id);</pre>
<p>Simply modify the view to give:</p>
<pre class="brush: php; title: ;">echo form-&gt;input(state_id, array('empty' =&gt; '--'));</pre>
<p>This will give you an entry up at the top that the user can select, which signifies <em>empty</em> with the text &#8220;&#8211;&#8221;. Change the text to anything you like and you&#8217;ll have the desired effect.</p>
Similar Posts:<ul><li><a href="http://www.webdevelopment2.com/cakephp-contact-form-quick-dirty/" rel="bookmark" title="November 7, 2008">CakePHP Contact Form &#8211; Quick and Dirty</a></li>

<li><a href="http://www.webdevelopment2.com/cakephp-12-beta-upgrade/" rel="bookmark" title="January 7, 2008">CakePHP 1.2 Beta Released Fresh Out of The Oven &#8211; Happy New Year</a></li>

<li><a href="http://www.webdevelopment2.com/cakephp-auth-component-tutorial-3/" rel="bookmark" title="April 9, 2008">CakePHP Auth Component &#8211; Will You Remember Me Tomorrow?</a></li>

<li><a href="http://www.webdevelopment2.com/ajax-activity-indicators/" rel="bookmark" title="December 30, 2005">Ajax Activity Indicators</a></li>

<li><a href="http://www.webdevelopment2.com/cakephp-feed-rule/" rel="bookmark" title="January 1, 2008">CakePHP &#8211; One RSS Feed To Rule Them All</a></li>
</ul><!-- Similar Posts took 4.173 ms -->]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopment2.com/stupid-cakephp-trick-day-generatelist-empty-slot/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Give Me 15 Minutes and I&#8217;ll Make You A jQuery Expert</title>
		<link>http://www.webdevelopment2.com/give-15-minutes-jquery-expert/</link>
		<comments>http://www.webdevelopment2.com/give-15-minutes-jquery-expert/#comments</comments>
		<pubDate>Tue, 18 Sep 2007 12:09:13 +0000</pubDate>
		<dc:creator>Kevin Lloyd</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.webdevelopment2.com/give-15-minutes-jquery-expert/</guid>
		<description><![CDATA[Introduction In the spirit of rapid web development, I&#8217;ve stumbled upon jQuery. Here&#8217;s a testimonial from a jQuery user: You start with 10 lines of jQuery that would have been 20 lines of tedious DOM JavaScript. By the time you are done it&#8217;s down to two or three lines and it couldn&#8217;t get any shorter [...]]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>
<p><a href="http://jquery.com/"><img src="http://www.webdevelopment2.com/wp-content/uploads/jquery_logo.gif" title="jQuery - Write Less, Do More" alt="jQuery - Write Less, Do More" align="left" /></a>In the spirit of rapid web development, I&#8217;ve stumbled upon <a href="http://jquery.com/">jQuery</a>. Here&#8217;s a testimonial from a <a href="http://jquery.com/">jQuery</a> user:</p>
<blockquote><p>You start with 10 lines of <a href="http://www.JQuery.com"  class="alinks_links" onclick="return alinks_click(this);" title=""  style="padding-right: 13px; background: url(http://www.webdevelopment2.com/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">jQuery</a> that would have been 20 lines of tedious DOM JavaScript. By the time you are done it&#8217;s down to two or three lines and it couldn&#8217;t get any shorter unless it read your mind.&#8221;</p></blockquote>
<p>In my experience it&#8217;s been more like five (5) lines of jQuery.</p>
<blockquote><p>jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. <strong>jQuery is designed to change the way that you write JavaScript</strong>.</p></blockquote>
<p>I&#8217;ve found jQuery great for the following reasons:</p>
<ul>
<li>Simple Ajax in a breeze</li>
<li>Search for elements in the DOM is made easy</li>
<li>The helper function [ $() ] is a pleasure to use</li>
<li>Most importantly: it handles cross browser compatibility.</li>
</ul>
<h3>Here We Go &#8211; Tutorials Galore</h3>
<p>Your first step will be to <span><a href="http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.2.1.pack.js">Download</a> jQuery 1.2.1 and include it in the head of your web page. After this you need to start reading some tutorials. Don&#8217;t worry, it&#8217;s going to take 15 minutes tops for you to start writing usable code:</span></p>
<ul>
<li><a href="http://visualjquery.com">Visual jQuery</a> &#8211; This is by far, my number one resource. It consolidates the API in a visual form, making easy to navigate.</li>
<li><a href="http://www.slideshare.net/simon/jquery-in-15-minutes/">15 Minutes of jQuery</a> &#8211; Great for beginners</li>
<li><a href="http://simonwillison.net/2007/Aug/15/jquery/">jQuery for JavaScript programmers</a> &#8211; Interesting tips on how to debug.</li>
<li><a href="http://docs.jquery.com/Tutorials:How_jQuery_Works">Tutorials:How jQuery Works</a> &#8211; Another beginner tutorial</li>
<li><a href="http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery">Tutorials:Getting Started with jQuery</a> &#8211; Getting Started (for beginners)</li>
<li><a href="http://docs.jquery.com/Tutorials:Live_Examples_of_jQuery">Tutorials:Live Examples of jQuery</a> &#8211; This is what worked for me. Sometimes you just have to see it in action.</li>
</ul>
<h3>Why I Use jQuery</h3>
<p>jQuery is fast, small, and easy to learn. It&#8217;s the core for many of the simpler Ajax I use in my web pages. Since I&#8217;m using CakePHP, there&#8217;s also <a href="http://www.prototype.com/"  class="alinks_links" onclick="return alinks_click(this);" title=""  style="padding-right: 13px; background: url(http://www.webdevelopment2.com/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">Prototype</a>, but that&#8217;s another story. I really don&#8217;t like having to learn a new language when I&#8217;m trying to do something simple. I don&#8217;t want to go delving into DOM and all that stuff just to dynamically add a class onto an element in the form. If I was a JavaScript programmer, it may not be a big deal for me. But, to me, there&#8217;s nothing worse than writing bad code to get something done, just because you don&#8217;t understand what&#8217;s going on. That&#8217;s why frameworks are what I live by.</p>
<p>Don&#8217;t wait, get started with jQuery today.</p>
Similar Posts:<ul><li><a href="http://www.webdevelopment2.com/jquery-prototype-mootools-benchmark-slickspeed/" rel="bookmark" title="January 28, 2008">JQuery, Prototype, and MooTools Benchmark &#8211; SlickSpeed</a></li>

<li><a href="http://www.webdevelopment2.com/bit-open-source-baz-background/" rel="bookmark" title="November 12, 2008">A Bit On Open Source And Some Baz Background</a></li>

<li><a href="http://www.webdevelopment2.com/ajax-activity-indicators/" rel="bookmark" title="December 30, 2005">Ajax Activity Indicators</a></li>

<li><a href="http://www.webdevelopment2.com/easily-increase-page-load-time-10-fold-jquery/" rel="bookmark" title="October 26, 2007">See How Easily You Can Increase Page Load Time 10 Fold With jQuery</a></li>

<li><a href="http://www.webdevelopment2.com/to-suck-or-not-to-suck-that-is-question-for-javascript/" rel="bookmark" title="December 31, 2006">To Suck or Not to Suck, That is Question for JavaScript</a></li>
</ul><!-- Similar Posts took 5.044 ms -->]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopment2.com/give-15-minutes-jquery-expert/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The Secret of CakePHP Advanced Routing &#8211; Even Better URLs</title>
		<link>http://www.webdevelopment2.com/the-secret-of-cakephp-advanced-routing-even-better-urls/</link>
		<comments>http://www.webdevelopment2.com/the-secret-of-cakephp-advanced-routing-even-better-urls/#comments</comments>
		<pubDate>Thu, 06 Sep 2007 14:23:01 +0000</pubDate>
		<dc:creator>Kevin Lloyd</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://www.WebDevelopment2.com/the-secret-of-cakephp-advanced-routing-even-better-urls/</guid>
		<description><![CDATA[The power of CakePHP has a lot to do with conventions. The framework (like many others) harnesses its power by enforcing certain conventions and standards that users must follow. You name your database tables, file names, etc; a particular way and boom, models, views and controllers are automatically created and ready for use. This is [...]]]></description>
			<content:encoded><![CDATA[<p>The power of CakePHP has a lot to do with conventions. The framework (like many others) harnesses its power by enforcing certain conventions and standards that users <em>must</em> follow. You name your database tables, file names, etc; a particular way and boom, models, views and controllers are automatically created and ready for use. This is the beauty of the MVC structure. Your URLs also follow thing structure: <em>www.site.com/controller/action/params.</em></p>
<h3>Straying From Convention</h3>
<p>But sometimes, conventions suck. Sometimes you want greater control over things, but still don&#8217;t wanna do them from scratch. The strictness of the MVC structure dictates how your URLs will look. Consider this: CakePHP has a basic pages controller, which you can use when you don&#8217;t need a model or controller. You just enter the view and voilÃƒ , a page. But your pages have a URL of:</p>
<blockquote><p><em>www.site.com/pages/page</em></p></blockquote>
<p>Wouldn&#8217;t you rather:</p>
<blockquote><p><em>www.site.com/page.htm</em></p></blockquote>
<p>The <a href="http://manual.cakephp.org/chapter/configuration">Routes Configuration</a> examples in the CakePHP manual are a bit simple. Here&#8217;s how to use a bit more advanced routing:</p>
<pre class="brush: php; title: ;">Router::connect('/(.*).htm', array('controller' =&amp;gt; 'pages', 'action' =&amp;gt; 'display'));</pre>
<p>This says, consider everything that comes in with an HTM extension and send the URL as a parameter to the <em>display</em> action on the <em>pages</em> controller.</p>
<p>The idea was <em>stolen</em> from <a href="http://cakeforge.org/projects/lumad-cms/">Lumad CMS</a>. They use the following in Rewrite in .<em>htaccess </em>for their pages:</p>
<p><code>RewriteRule    ^~(.*) content_pages/displayurl/$1 [L]</code><br />
They use a prefix of &#8216;~&#8217; instead of a suffix of &#8216;.htm&#8217;, but you get the picture. I&#8217;m sorry to disappoint you, I&#8217;m not as creative as you thought.</p>
<h3>How I Use Advanced Routing</h3>
<p>I maintain a makeshift CMS using CakePHP. In this project I have a basic model (<em>contents</em>) with a <em>title and body</em> fields, among others. I would use the pages controller, but I need end users to be able to end pages through the database.</p>
<pre class="brush: php; title: ;">Router::connect('/(.*).htm', array('controller' =&amp;gt; 'contents', 'action' =&amp;gt; 'view'));</pre>
<p>Conventions are great as long as they don&#8217;t get in the way. The great thing about CakePHP is that they frequently provide ways to get what you need done easily.</p>
<p>Make your <em>static</em> content look like static pages with Advanced routing.</p>
<p>Source: <a href="http://manual.cakephp.org/chapter/configuration">Routes Configuration</a> [CakePHP Manual]</p>
Similar Posts:<ul><li><a href="http://www.webdevelopment2.com/cakephp-bake-baking-models-controllers-views-cakephp-12/" rel="bookmark" title="November 21, 2007">CakePHP Bake &#8211; Baking Models, Controllers and Views the CakePHP 1.2 Way</a></li>

<li><a href="http://www.webdevelopment2.com/cakephp-auth-component-tutorial-1/" rel="bookmark" title="January 8, 2008">CakePHP Auth Component For Dummies Tutorial</a></li>

<li><a href="http://www.webdevelopment2.com/cakephp-installation-guide-just-add-water-and-2-medium-eggs/" rel="bookmark" title="August 27, 2007">CakePHP Installation Guide: Just Add Water and 2 Medium Eggs</a></li>

<li><a href="http://www.webdevelopment2.com/top-5-basic-seo-tips/" rel="bookmark" title="December 27, 2007">Top 5 Basic SEO Tips &#8211; You Can Do These Yourself</a></li>

<li><a href="http://www.webdevelopment2.com/enter-cakephp-rapid-development-framework-no-really/" rel="bookmark" title="July 2, 2007">Enter CakePHP &#8211; Rapid Development Framework &#8211; No Really!</a></li>
</ul><!-- Similar Posts took 4.357 ms -->]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopment2.com/the-secret-of-cakephp-advanced-routing-even-better-urls/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>XAMPP Lite on USB Disk &#8211; Benchmark PHP and MySQL by Slowing Down Your Server</title>
		<link>http://www.webdevelopment2.com/xampp-lite-on-usb-disk-benchmark-php-and-mysql-by-slowing-down-your-server/</link>
		<comments>http://www.webdevelopment2.com/xampp-lite-on-usb-disk-benchmark-php-and-mysql-by-slowing-down-your-server/#comments</comments>
		<pubDate>Wed, 29 Aug 2007 14:00:04 +0000</pubDate>
		<dc:creator>Kevin Lloyd</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.WebDevelopment2.com/xampp-lite-on-usb-disk-benchmark-php-and-mysql-by-slowing-down-your-server/</guid>
		<description><![CDATA[To develop PHP and MySQL on a Windows machine, I usually use WAMP. I had tried XAMPP before, but I found that it was a bit bloated, with the OpenSSL and FTP Server, etc. So WAMP it was. But lately, I decided to give XAMPP another try and I like what I&#8217;ve got so far. [...]]]></description>
			<content:encoded><![CDATA[<p>To develop PHP and MySQL on a Windows machine, I usually use <a href="http://www.wampserver.com/en/">WAMP</a>. I had tried <a href="http://www.apachefriends.org/en/xampp.html">XAMPP</a> before, but I found that it was a bit bloated, with the OpenSSL and FTP Server, etc. So WAMP it was. But lately, I decided to give XAMPP another try and I like what I&#8217;ve got so far.</p>
<p><a href="http://www.apachefriends.org/en/xampp.html" title="XAMPP Lite"><img src="http://www.webdevelopment2.com/wp-content/uploads/xampp-lite.gif" title="XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very easy to install and to use - just download, extract and start." alt="XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very easy to install and to use - just download, extract and start." align="left" border="0" /></a>For the past three weekends, I&#8217;ve been away from my personal computer. The only life line I&#8217;ve had is my stock of <a href="http://portableapps.com/apps">Portable Apps</a> on my 512MB USB disk. So I&#8217;ve been neglecting a few projects lately. But all of this has changed as of Friday. I&#8217;ve discovered XAMPP Lite. It&#8217;s just what it says it is, a Lite version of XAMPP. The beauty of this is that it can also run from a USB disk. There&#8217;s no install required. So partnered with XAMPP Lite, <a href="http://portableapps.com/apps/internet/firefox_portable">Mozilla Firefox, Portable Edition</a>, <a href="http://portableapps.com/apps/development/notepadpp_portable">NotePad++ Portable</a>, and, <a href="http://portableapps.com/apps/internet/filezilla_portable">FileZilla Portable</a> I can take my development on the road to anywhere I can stick in my USB disk.</p>
<h3>Added Bonus</h3>
<p>I don&#8217;t have to tell you that running an Apache web server, PHP 5.0 and MySQL from a USB disk is not a great idea for a production environment. Disk access to the USB disk is much slower than a hard drive. This has an unexpected benefit that I&#8217;ve noticed with CakePHP. Queries that used to take 3 milliseconds and 4 milliseconds now take 300 milliseconds and 400 milliseconds.</p>
<p>So why am I excited about stuff running so slowly? When you have a table with 20 fields, but only regularly use five (5), CakePHP makes it so easy write <em>$this-&gt;paginate() </em>or <em>$this-&gt;findAll(); </em>to retrieve results that we sometimes forget the all 20 fields are being returned every single time. You see the debug say that &#8220;<em>3 queries took 10 ms</em>&#8220;<em>.</em> You don&#8217;t really think much of it, but when the debug window says &#8220;<em>3 queries took 500 ms</em>&#8220;, you realize that you need to do some work. It makes you think about things that normalizing databases, and caching models, controllers, and views.</p>
<h3>Installing XAMPP</h3>
<p>There&#8217;s not really much to it. You <a href="http://www.apachefriends.org/en/xampp-windows.html#646">download XAMMP Lite</a>, dump it in a folder. That&#8217;s the first part. Now the configuration is where you have to be careful. There are two possible configurations:</p>
<ol>
<li>Root Directory Installation
<ul>
<li>Drop the XAMPPlite folder to the root of the USB Disk.</li>
<li>Modify your Apache and PHP configuration files as you normally would.</li>
</ul>
</li>
<li>Sub Directory Installation
<ul>
<li>Drop the XAMPPlite folder in a folder of your choice.</li>
<li>Run <em>setup_xampp.bat</em>. This will go through every configuration file and set the path based on the drive letter and installation directory. The problem with this installation is that you&#8217;ll have to do this every time you move to a system with a different drive setup (eg. At home my USB is G:, at work it&#8217;s F:)</li>
<li>Modify your Apache and PHP configuration files as you normally would.</li>
</ul>
</li>
</ol>
<p>Everything else you do is as normal. Happy developing. At 130 MB you can&#8217;t go wrong. At 130 MB a pop, you can&#8217;t go wrong.</p>
<p>Source: <a href="http://www.apachefriends.org/en/xampp-windows.html646">XAMPP 1.6.3a</a> [Apache Friends]</p>
Similar Posts:<ul><li><a href="http://www.webdevelopment2.com/quick-multiple-local-roots-wamp/" rel="bookmark" title="November 16, 2007">Here&#8217;s a Quick Way to Use Multiple Local Roots With WAMP</a></li>

<li><a href="http://www.webdevelopment2.com/fast-cgi-installation/" rel="bookmark" title="November 18, 2005">Fast CGI Installation</a></li>

<li><a href="http://www.webdevelopment2.com/cakephp-installation-guide-just-add-water-and-2-medium-eggs/" rel="bookmark" title="August 27, 2007">CakePHP Installation Guide: Just Add Water and 2 Medium Eggs</a></li>

<li><a href="http://www.webdevelopment2.com/cross-browser-compatible-designs/" rel="bookmark" title="December 26, 2007">Browsers Have Multiple Personalities, Your Designs Should Too</a></li>

<li><a href="http://www.webdevelopment2.com/installing-a-lamp-web-server-system-with-fedora-core-6/" rel="bookmark" title="October 31, 2006">Installing A LAMP Web Server System With Fedora Core 6</a></li>
</ul><!-- Similar Posts took 4.286 ms -->]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopment2.com/xampp-lite-on-usb-disk-benchmark-php-and-mysql-by-slowing-down-your-server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CakePHP Installation Guide: Just Add Water and 2 Medium Eggs</title>
		<link>http://www.webdevelopment2.com/cakephp-installation-guide-just-add-water-and-2-medium-eggs/</link>
		<comments>http://www.webdevelopment2.com/cakephp-installation-guide-just-add-water-and-2-medium-eggs/#comments</comments>
		<pubDate>Mon, 27 Aug 2007 15:04:20 +0000</pubDate>
		<dc:creator>Kevin Lloyd</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.WebDevelopment2.com/cakephp-installation-guide-just-add-water-and-2-medium-eggs/</guid>
		<description><![CDATA[Introduction As you guys know, I&#8217;ve recently discovered the marvels of rapid web development with CakePHP. This shall be the first in a long serious of CakePHP related material coming from me since I&#8217;ve now veered off on a slightly different focus. After a short analysis, I&#8217;ve picked CakePHP as my framework of choice. I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>
<p>As you guys know, I&#8217;ve recently discovered the marvels of rapid web development with CakePHP. This shall be the first in a long serious of CakePHP related material coming from me since I&#8217;ve now veered off on a <a title="New Domain and New Focus: Web Development 2.0, CakePHP" href="http://www.webdevelopment2.com/new-domain-webdevelopment2com-new-focus-frameworks-cakephp-javascript-web-20/">slightly different focus</a>.</p>
<p>After a <a href="http://www.webdevelopment2.com/enter-cakephp-rapid-development-framework-no-really/">short analysis</a>, I&#8217;ve picked <a href="http://www.cakephp.org/">CakePHP</a> as my framework of choice. I&#8217;ve been struggling through it for a few months now, but it&#8217;s by far better than the alternative of coding by hand (Yeah, I know I&#8217;m lazy). I&#8217;ve struggled through it so that you don&#8217;t have to.</p>
<h3>Downloading &#8211; Stable or Alpha Version</h3>
<p>Step one is <a href="http://cakeforge.org/projects/cakephp/">downloading CakePHP</a>. The first problem that you&#8217;ll run into is that there are two (2) versions to pick from: <strong>Stable 1.1 and Alpha 1.2</strong>. When I first started out, I needed to use CakePHP for a project instantly, so I decided to with the stable version because the word <em>alpha</em> scared me a little bit. I mean, it&#8217;s not even beta yet.</p>
<p>That was my big mistake. A lot of seasoned CakePHP developers will tell you that the alpha version is ready to go and can (and has been) used in production environments. There is of course the slim chance that some key function or component might change slightly, and you application may break on an upgrade for the alpha version, but that&#8217;s a chance that I&#8217;m willing to take. The <strong>alpha version has a lot more in place (emailing templates, authentication, pagination of results</strong>, etc), that it just makes everything worthwhile. Also, a lot of the newer tutorials you&#8217;ll find make specific reference to version 1.2. And let&#8217;s face it, version 1.2 is just way cooler.</p>
<p>If you&#8217;re just starting out, <strong>I still recommend the alpha version 1.2</strong>, because by the time you become well versed and need to crank out a web application or site version 1.2 may well be stable.</p>
<h3>Upload to Server</h3>
<p>One of the key things I was looking for with a PHP framework is compatibility with PHP 4.0. Some of my clients are on older servers and it&#8217;s harder to get someone who is already paying for a host to switch just because you said so. Here are the server requirements from the <a href="http://manual.cakephp.org/">CakePHP manual</a>:</p>
<blockquote>
<ul>
<li>An HTTP server (like Apache) with the following enabled:             sessions, mod_rewrite (not absolutely necessary but             preferred)</li>
<li>PHP 4.3.2 or greater. Yes, CakePHP works great in either PHP             4 or 5.</li>
<li>A database engine (right now, there is support for MySQL,             PostgreSQL and a wrapper for ADODB).</li>
</ul>
</blockquote>
<p>The manual recommends various methods of installation for development purposes and production environments. These recommendations are all well and good if you have your own server, but some things are simply not configurable with the shared hosts that most of us use these days.</p>
<p>I personally don&#8217;t see a problem with the development setup. The take the CakePHP folder and dump it the the www root of the site (if it&#8217;s the main site of course) or a subdirectory. The one tweak I would make, if your host allows, is to point your www root for that domain to the <em>app/webroot/</em> folder.</p>
<p>These are recommended for security purposes, but I haven&#8217;t seen a problem with any installation that I&#8217;ve had. As a matter of fact, this is one of the few times that I&#8217;ve heard someone recommend this type of setup. Even well established packages like <a href="http://www.wordpress.org"  class="alinks_links" onclick="return alinks_click(this);" title=""  style="padding-right: 13px; background: url(http://www.webdevelopment2.com/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">WordPress</a>, <a href="http://www.simplemachines.org/"  class="alinks_links" onclick="return alinks_click(this);" title=""  style="padding-right: 13px; background: url(http://www.webdevelopment2.com/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">SMF</a>, Zen Photo, <a href="http://www.phpbb.com"  class="alinks_links" onclick="return alinks_click(this);" title=""  style="padding-right: 13px; background: url(http://www.webdevelopment2.com/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">phpBB</a>, etc just need you to dump files in a folder.</p>
<p>There is something to be said about the recommended setup though. If you happen to run multiple installations of CakePHP and have different applications, in theory, all of them can share the same CakePHP base code and you&#8217;d have different application folders. But for right now, this is just a <em>get up and get started</em> guide. The only thing that you need to ensure is that the <em>app/tmp</em> directory and all subdirectories are writable.</p>
<h3>Configuration</h3>
<p>Everything you&#8217;ll need is in the app/config folder. The file <strong><em>core.php</em></strong> houses, well, core configuration settings. Here are a few of the main ones:</p>
<ol>
<li>
<pre class="brush: php; title: ;">define('DEBUG', 3);</pre>
<p>set&#8217;s the debug level. Use 0 for production</li>
<li>
<pre class="brush: php; title: ;">define('CAKE_ADMIN', 'admin');</pre>
<p>You&#8217;re almost always going to need this, so you might as well uncomment it now. This sets up admin routing so you can have urls like site.com/admin/events/</li>
<li>
<pre class="brush: php; title: ;">define('CAKE_SESSION_STRING', 'DYhG93guVoUubWwiR2G0FgaC9mi');</pre>
<p>A random string used for CakePHP sessions. You need to change this into something unique  or you might potentially leave holes in your app</li>
</ol>
<p>Then we have the <strong><em>database.php</em></strong> file. Modify the following to suite your database configuration:</p>
<pre class="brush: php; title: ;">var $default = array(
'driver' =&gt; 'mysql',
'persistent' =&gt; false,
'host' =&gt; 'localhost',
'login' =&gt; 'username',
'password' =&gt; 'passowrd',
'database' =&gt; 'database name',
'prefix' =&gt; ''
);</pre>
<p>I personally have a host that limits the number of MySQL databases that you&#8217;re allowed, so I&#8217;m forced to dump everything into one database. This makes the <em>prefix</em> option invaluable to me.</p>
<p>Lastly we have <strong><em>routes.php</em></strong>. This file is used to for URL routing. Consider the following:</p>
<pre class="brush: php; title: ;">Router::connect('/', array('controller' =&amp;gt; 'contents', 'action' =&amp;gt; 'view', 'home'));</pre>
<p>This is going to route the homepage site.com/ to my <em>contents</em> controller and run the <em>view</em> action and pass to this the parameter <em>home. </em>This is the same as going to: site.com/contents/view/home/. We can also do some other marvelous things with routing, but I&#8217;ll save those for later.</p>
<p>Depending on what your setup is and where you host, you might have to make modifications to the .htaccess file. I haven&#8217;t narrowed down  an explanation yet, but on various shared hosts, adding &#8220;<em>RewriteBase /</em>&#8221; solves a lot of problems, just keep that in mind.</p>
<p>Read more on the <a title="CakePHP configurations" href="http://manual.cakephp.org/chapter/configuration">CakePHP manual</a>.</p>
<h3>Launch</h3>
<p>Launch CakePHP and make sure your start up screen comes up. Then fire away are your Models, Views and Controllers.</p>
Similar Posts:<ul><li><a href="http://www.webdevelopment2.com/the-secret-of-cakephp-advanced-routing-even-better-urls/" rel="bookmark" title="September 6, 2007">The Secret of CakePHP Advanced Routing &#8211; Even Better URLs</a></li>

<li><a href="http://www.webdevelopment2.com/quick-multiple-local-roots-wamp/" rel="bookmark" title="November 16, 2007">Here&#8217;s a Quick Way to Use Multiple Local Roots With WAMP</a></li>

<li><a href="http://www.webdevelopment2.com/xampp-lite-on-usb-disk-benchmark-php-and-mysql-by-slowing-down-your-server/" rel="bookmark" title="August 29, 2007">XAMPP Lite on USB Disk &#8211; Benchmark PHP and MySQL by Slowing Down Your Server</a></li>

<li><a href="http://www.webdevelopment2.com/why-my-wordpress-27-install-failed/" rel="bookmark" title="December 11, 2008">Why My WordPress 2.7 Install &#8220;Failed&#8221;</a></li>

<li><a href="http://www.webdevelopment2.com/cakephp-bake-baking-models-controllers-views-cakephp-12/" rel="bookmark" title="November 21, 2007">CakePHP Bake &#8211; Baking Models, Controllers and Views the CakePHP 1.2 Way</a></li>
</ul><!-- Similar Posts took 11.929 ms -->]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopment2.com/cakephp-installation-guide-just-add-water-and-2-medium-eggs/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>New Domain: WebDevelopment2.com, New Focus: Frameworks, CakePHP, Javascript, Web 2.0</title>
		<link>http://www.webdevelopment2.com/new-domain-webdevelopment2com-new-focus-frameworks-cakephp-javascript-web-20/</link>
		<comments>http://www.webdevelopment2.com/new-domain-webdevelopment2com-new-focus-frameworks-cakephp-javascript-web-20/#comments</comments>
		<pubDate>Wed, 22 Aug 2007 15:00:40 +0000</pubDate>
		<dc:creator>Kevin Lloyd</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.webdevelopment2.com/blog/new-domain-webdevelopment2com-new-focus-frameworks-cakephp-javascript-web-20.htm</guid>
		<description><![CDATA[New Domain I has finally occurred to me that I should have gotten my own domain name a long time ago. Really, I don&#8217;t know what I was waiting for, but it was about time. Since my focus is Web 2.0, WebDevelopment2.com was an obvious choice. I&#8217;ve already written about moving wordpress to a different [...]]]></description>
			<content:encoded><![CDATA[<h3>New Domain</h3>
<p>I has finally occurred to me that I should have gotten my own domain name a long time ago. Really, I don&#8217;t know what I was waiting for, but it was about time. Since my focus is Web 2.0, WebDevelopment2.com was an obvious choice. I&#8217;ve already written about moving <a href="http://www.wordpress.org"  class="alinks_links" onclick="return alinks_click(this);" title=""  style="padding-right: 13px; background: url(http://www.webdevelopment2.com/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">wordpress</a> to a different domain, so moving to this domain was walk in the park. I loaded up PhpMyAdmin and exported my database. Pulled up Notepad++ and did a search and replace for my old URL to the new one. Saved the file, zipped it back up, and uploaded it to the server. Since I usually deal with large databases, I didn&#8217;t even bother trying to load into PhpMyAdmin. Bigdump is now my favorite database importer for MySQL.</p>
<p>Finally, I loaded up the  .htaccess file on the old domain name and slapped in a RewriteRule with a 301 redirect to WebDevelopment2.com. And Viola,Ã‚  here we haveÃ‚  WordPressÃ‚  blog perfectly redirected, without losing a single inbound link. Sure, the Page Rank on the domain name is 0 (for now), but with a name like Web Development, it won&#8217;t be for long.</p>
<h3> New Focus</h3>
<p>I must admit, that when I started this blog I was only vaguely interested in web development and web design. My interests usually hop about like that. I started this blog when AJAX hit the scene. It was the next hottest thing and the birth of Web 2.0. However, coding AJAX, although not difficult, was tedious. And we all know, I don&#8217;t like tedium.</p>
<p>Lately, things have gotten a bit more serious, with respect to my interests in web development. But, I&#8217;m no less lazy. As a result, my focus (and hence the focus of this blog) is going to shift slightly. Many of you will not notice, but those of you who have been paying attention will see that something has changed. I&#8217;ve come to learn the beauty of web development frameworks, such as CakePHP for PHP (duh), Protoype and <a href="http://www.JQuery.com"  class="alinks_links" onclick="return alinks_click(this);" title=""  style="padding-right: 13px; background: url(http://www.webdevelopment2.com/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">JQuery</a> for Javascript and AJAX, and even Blueprint for CSS. Don&#8217;t worry, if you haven&#8217;t heard of any of these, you soon will. Being as lazy as I am, the DRY (<strong>D</strong>o not <strong>R</strong>epeat <strong>Y</strong>ourself)Ã‚  principle naturally has you gravitating towards frameworks. If someone else; not just someone else, but an entire team of people, work on product for months and even years, I tend to think that they&#8217;ve done a better job than I ever code.</p>
<p>This is the new focus of my blog and I hope I don&#8217;t lose any of you guys and can bring greater quality and relevance to the things you read here.</p>
Similar Posts:<ul><li><a href="http://www.webdevelopment2.com/moving-wordpress-to-a-different-domain/" rel="bookmark" title="April 2, 2007">Moving WordPress To A Different Domain</a></li>

<li><a href="http://www.webdevelopment2.com/choice-web-development-framework-matter/" rel="bookmark" title="December 31, 2007">Your Choice of Web Development Framework Doesn&#8217;t Matter</a></li>

<li><a href="http://www.webdevelopment2.com/wordpress-comment-relish-and-high-cpu-usage/" rel="bookmark" title="December 29, 2008">Comment Relish Plugin + High CPU Usage &#8211; Fixed The Right Way</a></li>

<li><a href="http://www.webdevelopment2.com/understand-bias-means/" rel="bookmark" title="April 16, 2008">Do We Not Understand What Bias Means?</a></li>

<li><a href="http://www.webdevelopment2.com/quick-multiple-local-roots-wamp/" rel="bookmark" title="November 16, 2007">Here&#8217;s a Quick Way to Use Multiple Local Roots With WAMP</a></li>
</ul><!-- Similar Posts took 4.396 ms -->]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopment2.com/new-domain-webdevelopment2com-new-focus-frameworks-cakephp-javascript-web-20/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Enter CakePHP &#8211; Rapid Development Framework &#8211; No Really!</title>
		<link>http://www.webdevelopment2.com/enter-cakephp-rapid-development-framework-no-really/</link>
		<comments>http://www.webdevelopment2.com/enter-cakephp-rapid-development-framework-no-really/#comments</comments>
		<pubDate>Tue, 03 Jul 2007 02:14:54 +0000</pubDate>
		<dc:creator>Kevin Lloyd</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.webdevelopment2.com/cakephp/enter-cakephp-rapid-development-framework-no-really.htm</guid>
		<description><![CDATA[Almost two months ago I mentioned that I was looking into some PHP Frameworks I must say, that I&#8217;ve procrastinated with the whole thing. Since then I&#8217;ve caught up on a few. A friend of mine tried introducing me to Code Igniter framework. I didn&#8217;t really get a good feel for it. He mentioned that [...]]]></description>
			<content:encoded><![CDATA[<p>Almost two months ago I mentioned that I was looking into some <a href="http://www.webdevelopment2.com/?s=php+framework&amp;submit=Search">PHP Frameworks</a> I must say, that I&#8217;ve procrastinated with the whole thing. Since then I&#8217;ve caught up on a few. A friend of mine tried introducing me to <a href="http://codeigniter.com/" onclick="javascript:urchinTracker ('/outbound/article/codeigniter.com');">Code Igniter</a> framework. I didn&#8217;t really get a good feel for it. He mentioned that it was more powerful and flexible, but I&#8217;m lazy, so I was looking for a lazy man PHP Framework.</p>
<h4>Enter <a href="http://cakephp.org/">CakePHP</a></h4>
<p>Here&#8217;s a bit of background. I know you&#8217;ve heard of Ruby on Rails (RoR). I mean who hasn&#8217;t? Well, I&#8217;m one of those guys who never paid it much mind, and for that I was wrong <img src='http://www.webdevelopment2.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . RoR introduces the <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC</a> model: <a href="http://en.wikipedia.org/wiki/Model-view-controller">Model-View-Controller</a> pattern. What these Frameworks do is bring this pattern to the PHP platform and I love them for it.</p>
<p>CakePHP is a bit simpler than <a href="http://codeigniter.com/" onclick="javascript:urchinTracker ('/outbound/article/codeigniter.com');">Code Igniter</a> at first, so that&#8217;s what drew me to it. However, this weekend I stumbled upon the <a href="http://www.cakephp.org/screencasts/view/1">Baking</a> capability of CakePHP and I was hooked. I have an upcoming project, which I&#8217;ve decided to use CakePHP on. I will keep you posted on how things go.</p>
<p>This is what helped me make my decision: <a href="http://snook.ca/archives/php/codeigniter_vs_cakephp/#c50477">CodeIgniter vs. CakePHP</a></p>
<p>Good Luck to you guys.</p>
Similar Posts:<ul><li><a href="http://www.webdevelopment2.com/choice-web-development-framework-matter/" rel="bookmark" title="December 31, 2007">Your Choice of Web Development Framework Doesn&#8217;t Matter</a></li>

<li><a href="http://www.webdevelopment2.com/reader-input-what-php-framework-do-you-use/" rel="bookmark" title="April 9, 2007">Reader Input: What PHP Framework Do You Use?</a></li>

<li><a href="http://www.webdevelopment2.com/poll-results-php-framework/" rel="bookmark" title="November 28, 2007">Poll Results &#8211; What Do You Look for in a PHP Framework?</a></li>

<li><a href="http://www.webdevelopment2.com/how-do-i-pick-an-ajax-framework-and-why-should-i-care/" rel="bookmark" title="March 20, 2007">How Do I Pick An AJAX Framework And Why Should I Care</a></li>

<li><a href="http://www.webdevelopment2.com/understand-bias-means/" rel="bookmark" title="April 16, 2008">Do We Not Understand What Bias Means?</a></li>
</ul><!-- Similar Posts took 3.955 ms -->]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopment2.com/enter-cakephp-rapid-development-framework-no-really/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

