Tuesday, March 22, 2011

Number helper breaking a layout

I have this (simplified) line of code in a view:

echo $this->Number->format($data['distance'], array('places' => 1,
'before' => ''));

...which works fine when debug is > 0. When debug is set to 0, the
view renders but without a layout (almost as if inside a bare ajax
layout, but this is not the case and it is not an ajax call).

When trying to work out what was happening (which led me to the Number
helper) I realised that I am not including the Number helper in my
controller, so why it works when debug is 2 is a mystery - surely it
should error? I am equally baffled why it disrupts the layout when
debug is 0 but not when it is greater than 0. This behaviour
disappears completely when I echo out the value without the helper.

Anyone seen this before or can give me some pointers?

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate