Importance of using the CakePHP Helpers Importance of using the CakePHP Helpers

Uggghh, I hate to even be writing about this!  I have been spending the past two days cleaning up a project that has been running for over one year.  It was our first ever CakePHP project at our company and we were too lazy to be consistent about using $html->link() when creating our links.

Just recently the client has requested a change for their Facebook application.  We simply need to add a "requirelogin" HTML attribute to every link.


Sounds easy, right?  You bet it was, took me a total of 5 minutes to update the HTML helper to automatically add this HTML attribute to every link.  Great we're done then right?  Wrong!  We didn't create every HTML link with the HTML helper.

If we weren't so lazy a year ago when we were first learning CakePHP and took the time to learn the syntax (that is really quite easy) we could have saved ourselves two+ days of work fixing over 500 links that were not done this way :(

This is more of a rant than an article, but hopefully if you're reading this, you are taking advantage of the excellent helpers CakePHP provides!

Remember, just because you do not see a use in creating elements with a helper now (HTML, AJAX, FORM, etc...) down the road there certainly might be, so save yourself the headache and take advantage of the tools at hand!

Published on Mar 20, 2009

Tags: CakePHP Tutorial | helpers

Related Posts

Did you enjoy this article? If you did here are some more articles that I thought you will enjoy as they are very similar to the article that you just finished reading.

Tutorials

Learn how to code in HTML, CSS, JavaScript, Python, Ruby, PHP, Java, C#, SQL, and more.

No matter the programming language you're looking to learn, I've hopefully compiled an incredible set of tutorials for you to learn; whether you are beginner or an expert, there is something for everyone to learn. Each topic I go in-depth and provide many examples throughout. I can't wait for you to dig in and improve your skillset with any of the tutorials below.