Re: Concatenating object methods
- From: Michael Fesser <netizen@xxxxxx>
- Date: Wed, 31 Jan 2007 21:01:57 +0100
..oO(crater)
A question naturally arises from this. Is there a way to do the
following?...
[code]
$link1 = new htmlElement("a")->setAttribute("name", "value");
or
($link1 = new htmlElement("a"))->setAttribute("name", "value");
[/code]
It's not an issue. I'm just curious.
Nope. PHP's syntax doesn't allow that. You could write a function that
creates and returns the new object, something like
$link = createHtmlElement('a')->setAttribute(...);
Micha
.
- References:
- Concatenating object methods
- From: crater
- Concatenating object methods
- Prev by Date: Re: Concatenating object methods
- Next by Date: Re: redirection question
- Previous by thread: Re: Concatenating object methods
- Next by thread: Re: Concatenating object methods
- Index(es):