News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Stuart Herbert's Blog:
Quick Tip Get, Set and Query in One Method
December 12, 2007 @ 14:07:00

On his blog, Stuart Herbert has a quick tip showing how to mimic a feature of Ruby on Rails:

I'm still working on the next article in my series looking at PHP on servers, so in the mean time, check out this simple way to emulate Ruby's nice way of handling separate getter, setter and state query methods in PHP.

He admits his example isn't as elegant as the Ruby method, but it does get the job done. Code for the method is included in his post ready for cut and pasting.

1 comment voice your opinion now!
tip get set method cache rubyonrails example tip get set method cache rubyonrails example


blog comments powered by Disqus

Similar Posts

Alex Netkachov's Blog: BAT file tips

Nick Halstead's Blog: 10 Reasons why PHP is still very much alive

Gopal Vijayaraghavan's Blog: APC Autofilter: The Real Story

Mikko Koppanen's Blog: ImagickPixelIterator is not read-only after all...

Juan Treminio: Unit Testing Tutorial Part V: Mock Methods and Overriding Constructors


Community Events

Don't see your event here?
Let us know!


podcast series api laravel5 voicesoftheelephpant conference middleware community development interview framework introduction extension laravel wordpress opinion release library unittest language

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework