Zend and fluent interface

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
jamiel
Forum Contributor
Posts: 276
Joined: Wed Feb 22, 2006 5:17 am
Location: London, United Kingdom

Zend and fluent interface

Post by jamiel »

Hi all,

I am curious as to how Zend implement the fluent interface abilities in their framework. For example in Zend/Controller/Front.php I can see no override of the __call() method to return an instance of itself, and no methods return an instance of getInstance() . So I would be grateful if someone could explain why I can use call $front->addControllerDirectory('foo')->setDefaultAction('bar') .

Many thanks

Jamie
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

addControllerDirectory() returns $this.
Post Reply