Re: Architecture patterns in PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The pup architect framework Book on zend also has excellent detail on the mvc pattern

Bastien

Sent from my iPod

On Dec 28, 2008, at 5:38 PM, "Nathan Nobbe" <quickshiftin@xxxxxxxxx> wrote:

On Sun, Dec 28, 2008 at 3:29 PM, Michael C. Yates <quwieu@xxxxxxxxx> wrote:

Nathan Nobbe wrote:



Hey,

How do you structure your web applications? I am thinking in terms of
separating presentation  and logic. How is that done in PHP?


mvc is pretty popular, but php is so flexible you often don't need it for
smaller applications.

For example, if you take a page-controller approach, a php app is dead
simple.  You have a seperate entery point for evrything; login.php,
register.php, etc could be considered controllers, then all your common logic comes in via some includes, hopefully files outside the webroot. then you have some template directory w/ files that are a mixture of php and html(for example). your 'controller' files include the library code, hit
the db (if necc.) and then stuff data into the templates for output.

if you want to see an exmple if a more traditional mvc there are scads of open source frameworks out there which use a front controller approach. Code igniter is really straight forward, you can probly learn quickly from it.



Thanks for the reply.

Does anyone know of a good written guide about patterns like Front
controller, Page Controller, MVC etc. and how they are implemented in PHP?

I found something about these patterns in a guide on MSDN called Enterprise
Solution Patterns Using Microsoft .NET (
http://msdn.microsoft.com/library/ms998516(en-us).aspx<http://msdn.microsoft.com/library/ms998516%28en-us%29.aspx >
).

It describes MVC, Page Controller, Front Controller and a lot of other
patterns for ASP.NET applications.

Something like this for PHP would be cool.


i used to be a pretty big fan of
http://www.phppatterns.com
its a bit dusty (not updated in years) but a lot of the material is still
relevant, its free, and imo a great starting point.

also, google is your friend ;)

-nathan

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux