Matt Zandstra wrote a great and highly recommended article about The Observer Pattern for the Zend Developer Zone. The tutorial is geared at intermediate and expert users, and of course users of PHP5. Now, for those of you who - like me - sometimes still have to work with PHP Version Four, the example won't work out of the box.
Since the observer pattern came in quite handy for my current project, I'd like to share the minor fixes I had to apply to the code. The methods attach() and detach() are the only two methods you'll have to change. Just edit them like so:
function attach
($obs) { $this->observers[get_class($obs)] = $obs;}function detach
($obs) { unset($this->observers[get_class($obs)]);}
I don't know why Matt used delete() to detach an observer because in the manual it says under delete(): This is a dummy manual entry to satisfy those people who are looking for unlink() or unset() in the wrong place
. Whatever, I hope some of you will find my entry useful when hunting for this specific problem.
It's Timo again, now he's talking about his javascript MVC framework Jamal. This is a pretty awesome project. It's like CakePHP or Ruby On Rails for jQuery. Advanced stuff!
Dirk stellt jetzt jQuery vor. I've played around with this javascript framework before, yes even used it in a project, but I still need to learn more about it. Be sure to check out VisualQuery, too. Example (bad): BOA ;O) Also, check out the "Fisheye menu" demo at this page (click link at bottom of page). Awesome. You can also select only the specific parts of jQuery for download that you need for your project, thus reducing size even further.
The next session is about Jamal.
I've taken some photos at BarCamp Frankfurt and uploaded them to Flickr. See my photos here, or go directly to the BarCamp Frankfurt Pool.
We're waiting for the session to begin. Ok, here we go. Timo Derstappen helped realize a project with the help of CakePHP and will now introduce us to this framework. Everybody says "hello" now. Lots of PHP developers in here, but also "normal" people. CakePHP was inspired by (Ruby on) Rails, of course, and wants to take much of the basic work away from the developer (DRY). Other keywords: unit testing, convention over configuration, rapid web development, MVC, scaffolding. Someone mentions Selenium for frontend testing. (checking football halftime results meanwhile) Problems of CakePHP: works with lots of arrays, not objects, because it still runs on PHP4. Symfony, e.g., runs on PHP5 only. Still, ormigo is completely based on CakePHP, so it seems to be a very useful framework. I will have to take a second look.