Posted on 26 October 2009, 2:13 pm, by klenwell, under
Failsafety.
Just came across a post from a few months ago where I stated that CakePhp doesn’t support bind parameters. I have learned since then that this is not true. Happily, it does support bind parameters. An example I have used successfully: function query_bottom_count($bottom_value, $start_uts, $end_uts) { $sql = <<<XSQL SELECT REPLACE( SUBSTRING_INDEX( SUBSTRING_INDEX( last_result_url, '://', [...]
Posted on 24 September 2009, 9:23 pm, by klenwell, under
Projects.
One of the most challenging issues I’ve found in developing with CakePhp is unit testing. Testing models, with its dependence on fixtures, is especially touchy. The documentation, while constantly improving, still seems at crucial points incomplete or inconsistent. In this post, I’d like to draw attention to a few pitfalls that I burned a few [...]
Posted on 20 August 2009, 7:21 pm, by klenwell, under
Projects.
Project Cakewell is a CakePhp prototype application. Its main purpose is to document and demonstrate useful concepts and features of a web application built with the CakePhp framework. These include things like unit testing a component, creating a working fixture , and configuring your application to automatically detect the server environment and set the debug [...]
Posted on 31 January 2009, 9:28 am, by klenwell, under
Code Case.
Problem In CakePhp, I want to invalidate a field submitted in a form and set the error message dynamically. If the error message is set by a validation parameter within the model, the new message should override that error message and be displayed by the form in the view. Overview Consider the following three cases [...]
Posted on 17 January 2009, 11:05 am, by klenwell, under
Code Case.
I wanted to use the CakePhp pagination helper to paginate some complex records. The model that the paginator was referencing had both belongsTo and hasMany associations. belongsTo associations are not a problem. hasMany, I discovered, are — which makes sense when I think about. As the ticket notes: You can only paginate LEFT JOIN tables [...]