aykut yaman
aykut yaman

Reputation: 41

Object indentation in emacs php-mode

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.

Upvotes: 0

Views: 515

Answers (2)

user594138
user594138

Reputation:

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.

Upvotes: 0

Bozhidar Batsov
Bozhidar Batsov

Reputation: 56595

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.

Upvotes: 1

Related Questions