Category: CakePHP

  • Interesting CakePHP Bakery Components

    I enjoy researching what other people are doing in the CakePHP world and I came across several interesting components at CakePHP’s bakery website:

    Wizard Component

    http://bakery.cakephp.org/articles/jaredhoyt/2010/09/10/wizard-component-1-2-1

    This component looks pretty neat and easy-to-use.  You import the component and set a list of steps that the wizard will traverse through.  You then create views for those steps with forms that submit to themselves.  The wizard will then process the form and proceed to the next step for you persisting the data along the way.

    Breadcrumbs Component

    http://bakery.cakephp.org/articles/rees/2010/08/14/breadcrumbs

    This is a component and helper all-in-one.  Inside your controllers, you define the breadcrumbs in each function and you alter your app controller to automatically render the breadcrumbs on each page for you making it a pain-less process to add breadcrumbs to your site!

    SMS Text Message Component

    http://bakery.cakephp.org/articles/donald_jackson/2010/08/14/component-to-send-sms-text-messages

    This is a component that is written specifically for Panaceamoblie that is a helpful service to allow your website to send SMS services.  It works very similar to the EmailComponent.

  • CakePHP 2.0 Rant Retraction

    In yesterday’s article, it appears I may have misunderstood something regarding lazy loading.  I incorrectly read it as “loading the data” on-demand oppose to loading the object on-demand.  This actually looks like a great feature, especially after reading this: http://bakery.cakephp.org/articles/Frank/2010/08/10/optimizing-model-loading-with-lazymodel

    It appears associated models would automatically be loaded simply because they are related to the model you are querying, even if you are not retrieving data from it.

    Thanks for the clarification on lazy loading Jose and I’m actually quite excited to see this change after further research into the situation.  Check out these benchmarks from the above mentioned article:

    Before lazy loading

    Total Requests made: 100
    Total Time elapsed: 6.8480186462402 (seconds)
    Requests/Second: 14.603 req/sec
    Average request time: 0.068 seconds
    Standard deviation of average request time: 0.002
    Longest/shortest request: 0.078 sec/0.066 sec
    Memory usage: 9.75MB

    Post lazy loading

    Total Requests made: 100
    Total Time elapsed: 4.8957378864288 (seconds)
    Requests/Second: 20.426 req/sec
    Average request time: 0.049 seconds
    Standard deviation of average request time: 0.001
    Longest/shortest request: 0.056 sec/0.048 sec
    Memory usage: 7.25MB

    Almost 6 full requests more per second!  Just in the 100 requests made there is over 2 seconds being gained!  Excellent work community!

  • CakePHP 2.0 Rant

    I was recently visiting the CakePHP bakery and decided to read a little bit about CakePHP 2.0-dev.  I’ve rather enjoyed CakePHP as a framework since version 1.1 all the way through to version 1.3.  However, after reading some of the “features” for version 2, I have to say, I’m a little disappointed about their focus. (more…)

  • Using the TextHelper with CakePHP

    Really, the TextHelper?  Yes, this is probably one of the most overlooked helpers in CakePHP.  Sure we all know about the HTML Helper, Form Helper, JS Helper, etc… but how many of us use the Text Helper?  I’ve seen so many custom functions for truncating text and adding an ellipsis (…) to the end of it.  How about replacing email addresses with links?  Etc…  No more I say!  Let’s begin explorining the Text Helper now. (more…)

  • Modifying the CakePHP Bakery Templates

    One of the keys to a successful website is a good user flow especially when leveraging jQuery template.  What defines a good user flow?  At the very core, it requires simple navigation, being able to find what you’re looking for, and being able to do it quickly.  CakePHP’s bakery let’s you quickly create websites that list, add, edit, and delete data.  All you need to do is create a database table and run a few simple bakery commands and this will be done for you.

    The basic templates provided are pretty good.  They include links to do all of the above as well as pagination and sortable headers on the table listing page.  I find them a little bland and very “techie”.  Most customers don’t like this, so let’s alter them to suit are needs. (more…)