On 1/17/08 5:06 PM, "John Campbell" <[EMAIL PROTECTED]> wrote:
> Class Simple_Template {
...
>    function assign($k,$v) {
>       $this->_data[$k] = $v;
>       return $this;
>    }
...
> }
...
> $tpl = new Simple_Template();
> $tpl->assign('title','My First Page')->assign('message','Hello World'); //
chainability is fun

Just a short note to highlight an important, but tangential concept here --
chaining.

$tpl->assign('title','My First Page')->assign('message','Hello World');

Very cool concept. If you haven't already done so, check out jQuery, which
makes extensive use of this concept -- a method returning the calling
object.


_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to