0

I would like to have this indentation like Zend does on objects:

$this->getResponse()
     ->appendBody('Hello World');

But what I have now is:

$this->getResponse()
  ->appendBody('Hello World');

and I don't have any idea how I can do in this way. Thanks.

Charles
  • 50,943
  • 13
  • 104
  • 142
aykut yaman
  • 41
  • 1
  • 4

2 Answers2

1

php-mode is a fairly primitive mode that doesn't quite get the semantics of PHP. It's based on cc-mode so you can tweak its indentation settings by tweaking cc-mode's settings. There is an overview of the settings here, but cc-mode has a lot more that you can play with. Take a look at this question as well.

Community
  • 1
  • 1
Bozhidar Batsov
  • 55,802
  • 13
  • 100
  • 117
0

Recent releases of php-mode (available via MELPA) can do what you want; simply set php-lineup-cascaded-calls to t in your emacs configuration.

(setq php-lineup-cascaded-calls t)

Or use the customization interface M-x customize-group RET php RET.

Tom Regner
  • 6,856
  • 4
  • 32
  • 47