suggestion for future version!

Mizpah 10 Oct, 2009
Heya Bob,

I was just thinking whilst writing some printf($var) and if mysql error tyep statements to debug somthing, tht it woudl be great to be able to hook into chrono's debug function.

Now I am sure there must be a way to check to see if debug is turned on, and based on an if run a piece of code, but I was thinking about how any error output might be neatly presented.

Perhaps a 'custom debug' box in the interface (per form), put your code outputting information/errors from variables into the box. and just capture them elsewhere where ever they need to be in the code ?

Then if debug is turned on, you can have your own output debug bullets (after the standard ones) ?

I might be overcomplicating things here, butit strikes me that a framework for capturing and outputting debug messages thats accessable via chrono might be usefull to quite a few people!

cheers!

/Miz
GreyHead 10 Oct, 2009
Hi Mizpah,

You can try checking $debug - that's the variable that ChronoForms uses internally. The code that I use would look like this
(a) for display in-line[syntax=php]<?php
if ( $debug ) echo '<div>$var_name: '.print_r($var_name, true).'</div>';
?>[/syntax]
or to show on the next page-load [syntax=php]<?php
global $mainframe;
if ( $debug ) $mainframe->enqueuemessage('$var_name: '.print_r($var_name, true));
?>[/syntax]
Bob
This topic is locked and no more replies can be posted.