20 Jan 2010 @ 4:37 PM 

CakePHP offers a lot of functionality to us as developers. The ability to develop websites rapidly provides a trade-off in how quickly the website will load. As we expand our skills, we will learn the techniques that will slow down/speed up performance.

Objectives

  • Apply techniques to speed up CakePHP’s load time
  • Optimize our queries
  • Cache query results

More »

  • Share/Bookmark
Posted By: Jamie
Last Edit: 04 Feb 2010 @ 05:10 PM

EmailPermalinkComments (1)
Tags
 15 Nov 2009 @ 5:24 PM 

Two of the biggest things that will improve your search engine rankings are keyword rich website titles and keyword rich links to your content. Today’s lessons will cover both of these topics.

Objectives

  • Improve our search engine rankings
  • Set a title tag
  • Map a specific URL to a custom controller and action
  • Avoid using ids or numbers in our URL

Before I start, I would like to make it clear that this article is and does not intend to be a be-all-to-end-all of the SEO necessities for your website. It is meant to describe some excellent techniques to quickly and easily improve upon CakePHP to make it more SEO friendly. More »

  • Share/Bookmark
Posted By: Jamie
Last Edit: 15 Nov 2009 @ 05:25 PM

EmailPermalinkComments (3)
Tags
 20 Aug 2009 @ 5:06 PM 

Ugggh what a disaster today was!  On a client’s site, we have an older version of CakePHP, pre containable functionality.  Because of this, we have to use unbindModel and bindModel to accomplish the same functionality.

Over the past while, it has not been such a big deal.  However, for some other unknown reason, a search feature wasn’t returning back the appropriate associative data.  This had been working for quite some time, then suddenly stopped.  As I mentioned, I’m not exactly sure when and why it stopped working, but it did. More »

  • Share/Bookmark
Posted By: Jamie
Last Edit: 20 Aug 2009 @ 05:06 PM

EmailPermalinkComments (0)
Tags
Tags:
Categories: CakePHP
 23 May 2009 @ 11:44 AM 

It seems like photo sharing and social network applications are the in thing right now. Let’s take advantage of this. Today I will provide a simple class that will allow you to post photos to a user’s Photobucket account in minutes.

Step 1: Visit http://photobucket.com/developer/register to register for an API key

Follow the steps to create a new application on Photobucket. When you have finished, Photobucket will send you an email with your API and Secret key. Keep this email for later use.

More »

  • Share/Bookmark
Posted By: Jamie
Last Edit: 23 May 2009 @ 11:44 AM

EmailPermalinkComments (2)
Tags
 18 May 2009 @ 4:11 PM 

The Facebook Application API is quite extensive and allows you to get and set many different aspects of a user’s Facebook information.

Today, we are going to discuss using the Facebook API to create an album, if it doesn’t already exist, and add a photo to that album. More »

  • Share/Bookmark
Posted By: Jamie
Last Edit: 18 May 2009 @ 04:13 PM

EmailPermalinkComments (1)
Tags
 25 Apr 2009 @ 7:32 AM 

If you haven’t noticed already, at times CakePHP can be a little slow loading!  The reason for this is quite simple.  Rapid Application Development.  To allow for RAD, sometimes we must give up something, in this scenario it’s a bit of speed when loading.  Don’t worry, CakePHP offers some excellent utilities to help with this.

The one I will focus on today is caching our CakePHP query results.  The key to this is, we are caching the results, not the queries themselves.  If you know databases well, you may be thinking, “why do I want to cache queries, doesn’t my database server do this already?”  The answer to the question is, yes it does.  However, CakePHP still needs to call the database query and parse your results.  What I’m proposing, will avoid both of those steps and allow you to just retrieve the results.

This process not only avoids excess load on the database, it also reduces PHP’s processing time that CakePHP has to do to provide you with such useful arrays. More »

  • Share/Bookmark
Posted By: Jamie
Last Edit: 24 Apr 2009 @ 08:35 PM

EmailPermalinkComments (7)
Tags
Tags: ,
Categories: CakePHP, Optimization
 13 Apr 2009 @ 9:23 AM 

My pet peeve list seems to grow on a regular basis.  One of them is poorly optimized code.  Not only is the code I’m going to discuss poorly optimized, it’s from the documentation of CakePHP!

If you search for creating custom pagination in CakePHP, you will find quite a few results, potentially this one.  The one that I would assume the best would be the one from CakePHP itself, but it’s not and let me show you why. More »

  • Share/Bookmark
Posted By: Jamie
Last Edit: 13 Apr 2009 @ 09:23 AM

EmailPermalinkComments (9)
Tags
 10 Apr 2009 @ 11:37 AM 

Good Friday to all.  Over the past several weeks I have been working a lot with the AuthComponent in CakePHP and have learned a couple of lessons that I wanted to share with you all.

The title calls them “flaws”, but I suppose this isn’t completely accurate, it depends how you look at it.  To me they are flaws because I assumed the AuthComponent worked one way, only to find out different. More »

  • Share/Bookmark
Posted By: Jamie
Last Edit: 10 Apr 2009 @ 11:37 AM

EmailPermalinkComments (7)
Tags
Tags:
Categories: CakePHP
 08 Apr 2009 @ 3:35 PM 

I am starting to really dislike the PHP function isset().  Today, I was working on a registration system in CakePHP and my password validation was not working.  If I left the password field blank and clicked submit, it would come back with other errors, but then the password would come back populated with a long string – a hashed version of an empty string!

After some investigation, I discovered that the AuthComponent in CakePHP was doing an isset() check on the username and password fields.  If isset() returned true for both, it would hash the password. More »

  • Share/Bookmark
Posted By: Jamie
Last Edit: 08 Apr 2009 @ 03:35 PM

EmailPermalinkComments (12)
Tags
Tags: ,
Categories: CakePHP, php
 28 Mar 2009 @ 4:30 AM 

Have you found yourself wanting to remove validation on a specific field in a specific form?  Yes?  Excellent, you found the right place.

If you haven’t had the need for this, a great example of where you would want to accomplish this would be in a users edit form.  Normally in CakePHP we would encrypt the password, especially if you are using the AuthComponent, so we wouldn’t want the password prefilled on our form.  Instead, we’ll make it blank and place a note underneath that says “Only enter a password if you wish to change it”.

The above shouldn’t be difficult, however, when you go to use the form, you will get some unexpected results.  I keep getting a message saying that I must enter a password, because I had setup validation on that field for the registration process.  Below is a simple solution to this problem. More »

  • Share/Bookmark
Posted By: Jamie
Last Edit: 28 Mar 2009 @ 04:30 AM

EmailPermalinkComments (3)
Tags
Tags: ,
Categories: CakePHP

 Last 50 Posts
 Back
Change Theme...
  • Users » 14
  • Posts/Pages » 75
  • Comments » 236
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight