English 中文(简体)
PHPStorm php-code indentation
原标题:PHPStorm php-code indentation
  • 时间:2011-06-03 02:48:48
  •  标签:
  • phpstorm

我需要适当缩减这些法典的空白:

$this->render( rights , array(
     admin  => $admin,
     editor  => $editor,
     author  => $author,
));

and:

<?php $this->widget( zii.widgets.CMenu , array(
     items  => array(
        array( label  =>  label ,  url  =>  url )
    )
)); ?>

如果没有PHPStorm环境,那么这一法典就象这样:

$this->render( rights , array(
                              admin  => $admin,
                              editor  => $editor,
                              author  => $author,
                        ));

我去了“地貌”和“地貌”;“闪光”和“布拉斯”,并在以下选择中做了改动:

  • Array initializer -> Align when multiple (uncheck)
  • Method call arguments -> Align when multiple (uncheck)

结果是:

$this->render( rights , array(
         admin  => $admin,
         editor  => $editor,
         author  => $author,
    ));

然而,并非我所希望的风格,而是我设法做到的。 请让我谈谈我需要改变的选择吗?

问题回答

Try selecting all the code and clicking : Ctrl + Alt + I
It s auto indentation shortcut ...

It seems a to be a known issue. Please watch/vote or add your comments there.

I think this will help you in formatting Your code https://laracasts.com/series/how-to-be-awesome-in-phpstorm/episodes/8

我发现,不核对以下方案解决了我的问题:

缩略语 Format > PHP > Tab Wrapping and Braces >Function/ructor calls debate > 多线

这修改了以下法典:

var $numbers = $this->thing(array(
                                "one",
                                "two",
                                "three",
                                "four",
                                "five",
                                "six"
                            ));

形式如下:

var $numbers = $this->thing(array(
    "one",
    "two",
    "three",
    "four",
    "five",
    "six"
));




相关问题
Show .idea folder in PhpStorm project tool window

PhpStorm hides the .idea folder in the project tool window by default. However, I d like to show it in order to inspect the files and add/edit a .idea/.gitignore file to include and exclude specific ...

Wrong syntax highlighting for PHP file in PHPStorm

I don t know what happened but syntax highlighting for one php file stopped to working and also icon next to the file has changed. It shows it s text file instead of PHP . How can I fix that ?

How to activate function reference in WebStorm/PHPStorm?

Is there function reference integrated in PHPStorm/WebStorm ? I mean like when i point my cursor on some php function , then I press e.g. F1 and it will show me function details (parameters, usage...)...

NetBeans "Shift Left" analog on PHPStorm

I am deciding to migrate from NetBeans to PHPStorm IDE, and the only feature I have not found in PHPStorm is "Shift Left (Right), Move Down (Up)", which moves a line on one tab to the left, right, or ...

PHP developing suite? [closed]

I use Visual Studio to develop C#, C++ for about 10 years. Is there a free or inexpensive development platform similar to Visual Studio Express (maybe even a plugin for Visual Studio!) that would ...

JetBrains WebIDE: PHP variable type hinting?

Is there a way to hint WebIDE that a variable has some type? I have to iterate an array of objects, and there s no auto-completion available. This helps in ZendStudio: /* @var ClassName $object */ I ...

热门标签