Reply to Re: Concatenating object methods

Your name:

Reply:


Posted by Michael Fesser on 01/31/07 20:01

..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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация