Category Archives: Data Manipulation

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. Read more »

Share

StringExtractComponent for CakePHP

Hi folks, I have just finished creating my first CakePHP component and I wanted to share it with the community.  After I finish writing this article, I will be submitting it to CakePHP for inclusion.

The component is called StringExtractComponent.  As you may guess, it extracts content from a piece of content.  I have created this component to mimic the STREXTRACT function in Microsoft Visual FoxPro.  I have come to fall in love with this function because it makes retrieving data from a string with a start and end delimiter.

To help you understand how it is used, I read the contents of one of my articles into a string.  I then proceed to extract a specific section that is contained within the code syntaxes that exist in the article. Read more »

Share

Buy one of my books