php code refomatting question

I like my sprintf code to be formatted like this:
$sql = sprintf("INSERT INTO jamroom_ ()
                         VALUES( '%s',
                                        '%s' )",
          mysql_real_escape_string(),
          mysql_real_escape_string()
);

but the closest i could get it with code formatter settings was
$sql = sprintf("INSERT INTO jamroom_ ()
                         VALUES('%s',
                                        '%s' )", mysql_real_escape_string(), mysql_real_escape_string()
);

Is there any setting to move those mysql_real_escape_string's down to align with sprintf?  or at least keep the one below the other style?

Thanks

2 comments
Comment actions Permalink

Michael,
if you want to preserve line breaks, you might want to check the option Wrapping and Braces|Keep when reformatting|Line breaks. Alternatively you may set "Method call arguments" to "Wrap always" and check the box "Put ')' on new line. This will pretty much give the same result for your example. On the other hand there is no way to align the arguments with the function name, you can only align the arguments between themselves.

0
Comment actions Permalink

Thanks Rustam,

this was the one that worked for me: ".....check the option Wrapping and Braces|Keep when reformatting|Line breaks....."

Perfect, thanks!

0

Please sign in to leave a comment.