Categories
HTML5

HTML5 <input> placeholder attribute

So I set out to add some placeholder text for login fields in my CakePHP project. First I tried the default attribute, and then started implementing some Javascript to clear the text from the field on focus. Then I remembered the awesomeness that is HTML5 has introduced the placeholder attribute to the input tag. Placeholder text […]

Categories
CakePHP

Integrating dompdf with CakePHP

I was under a lot of pressure to quickly implement PDF reports in my CakePHP application. Luckily I came across this excellent tutorial. dompdf is an HTML to PDF converter written in PHP. It is a style-driven renderer: it will download and read external stylesheets, inline style tags, and the style attributes of individual HTML elements. […]

Categories
CakePHP

CakePHP: clear setFlash() message if back button is used

I had the following problem with setFlash() in my CakePHP application. CakePHP makes the basic CRUD workflow pretty easy to achieve. However, the following situation arose in the application I am building at work: I have a page which list things, and which includes an edit button upon clicking the edit button, editing the thing, and submitting […]