RSS DAILY NEWS TICKER EXAMPLE


home > overview

Alex Netkachov's Blog: PHP fluent API tips




In response to Travis Swicegood's post about fluent APIs, Alex Netkachov has added some of his own examples to the topic from the Zend Framework and the popular Javascript library, jQuery.

In his recent post Travis Swicegood is talking about the "Fluent API". This kind of API is very popular in scripting languages and I use it during my work with Zend Framework or jQuery projects. Another good example of such technique is Document Object Model API.

His examples show the method chaining that's the hallmark of fluent interfaces. Unfortunately, there's no good way to just make an object and call a fluent interface on it in PHP, so Alex suggests a simple little wrapper (that just returns the object) to make it easier.




click here to see original article or to find similar articles

 RSS DAILY HEADLINES

HEADLINES

Lieberman risks payback from Democrats

Sept. 2: Sen. Joe Lieberman, I-Conn., explains to delegates that he is at the RNC, not as a Republican or Democrat, but to support John McCain because he is the “best choice to bring our country together and lead our country forward.† (MSNBC)Senate Democrats hinted at payback for Sen. Joe Lieberman, who called Barack Obama an untested candidate beholden to Democratic interest groups in a prime-time GOP convention address.


China imposes Ramadan security crackdown in Muslim northwest (AFP)

Police search ethnic Uighurs in Kashgar. Authorities in China's Muslim-populated far northwest are seeking to prevent mass prayers and the distribution of religious material as part of a security crackdown for Ramadan(AFP/Peter Parks)AFP - Authorities in China's Muslim-populated far northwest are seeking to prevent mass prayers and the distribution of religious material as part of a security crackdown for Ramadan, government notices said.


Rice set for historic Libya visit, meeting Gaddafi (Reuters)

Secretary of State Condoleezza Rice smiles as she arrives at Tbilisi airport July 9, 2008. (David Mdzinarishvili/Reuters)Reuters - Condoleezza Rice travels to Libya on Friday, the first trip there by a U.S. secretary of state in 55 years, signaling improved ties between the two countries.



Find this article in Google