A little help on reformating code

Would need a little help on reformatting codes using PHPStorm.

was wondering how do I inline php tags in .tpl files for phpstorm. For example, I would like

<option value="value"<?php echo $value == 'value' ? ' selected="selected"' : ''; ?>><?php echo $value; ?></option>

Instead of  the following

<option value="asset"
<?php echo $type == 'asset' ? ' selected="selected"' : ''; ?>><?php echo $text_asset; ?></option>

when I use the phpstorm reformat code function
Another thing is that phpstorm adds a blank line after the <?php tag.


// More codes...

I would like the following instead

// more codes...

Any help would be great. Thank you :)


Comment actions Permalink

1. What's your exact IDE version (Help | About)? Try EAP, I can not reproduce the first issue with the default settings there:http://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Early+Access+Program .

2. Can not reproduce either - if EAP won't help, export your settings (File | Export settings) and provide the settings.jar file.

Comment actions Permalink

I have attached the settings file in this reply.

With regards to the second issue, I managed to fixed that. It was the reformatting adding a blank line before my classes, so it ended up having a blank line after the <?php tag.

For the first issue, when attempting to reformat codes, it is still happening. Inline php codes get reformatted to the next line. couldn't stay inline.

Comment actions Permalink

Add "option" tag to the: File | Settings (Preferences for Mac OS) | Editor | Code style | HTML | Other | Inline elements (http://i.imgur.com/qb1akVa.png)


Please sign in to leave a comment.