By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,934 Members | 1,527 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,934 IT Pros & Developers. It's quick & easy.

The Mediator pattern in PHP 5

P: n/a
I finally pieced together what I think is a good example of the
Mediator Pattern in PHP 5. See what you think.

http://www.fluffycat.com/PHP-Design-Patterns/Mediator/

I have, per request, tried to simplify my test program structure a
bit. testMediator.php has only one html tag in it - a <BR>. This is
in my new writeln() function, which adds '<'.'BR'.'>' to each line and
echos. If you just add a '<BR>' after each line the program would run
fine, but the source code would not display properly.

So, see if you like the new test structure better. Most of the other
PHP design patterns on www.FluffyCat.com/PHP-Design-Patterns still
have the old test formatting system, but if this proves more readable
I'll redo the others as well.
Dec 14 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
FluffyCat wrote:
I finally pieced together what I think is a good example of the
Mediator Pattern in PHP 5. See what you think.

http://www.fluffycat.com/PHP-Design-Patterns/Mediator/

I have, per request, tried to simplify my test program structure a
bit. testMediator.php has only one html tag in it - a <BR>. This is
in my new writeln() function, which adds '<'.'BR'.'>' to each line and
echos. If you just add a '<BR>' after each line the program would run
fine, but the source code would not display properly.


htmlspecialchars()?
http://php.net/htmlspecialchars

--
Oli

Dec 14 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.