Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Ninging It (See related posts)

I love http://www.ning.com/ - and I fell in love with chaining whole bunches of objects together.


class Foo {
    function transform() {
         //Some actual code
         return $this;
    }

    function transform2() {
         //Some actual code
         return $this;
    }

}

$f = new Foo();
$f->transform()->transform2()->transform();


Concise!

Comments on this post

Charlie posts on Feb 17, 2006 at 20:01
It's cool isn't it?

If you like this and are ready for a head-rush, go check out the chaining and nesting of array indexors in my random password generator script:
http://www.bigbold.com/snippets/posts/show/1487

You need to create an account or log in to post comments to this site.


Click here to browse all 5146 code snippets

Related Posts