views:

145

answers:

3

I'm relatively new to PHP and have been writing a project using what I believe is a fairly basic file architecture - all files and sub-folders within one main site folder accessed separately. Within the project, I've been using the Zend Framework as more of a library than an actual framework. I'm happy with Zend and using it like this makes things very easy. However, I have recently been starting to dread the maintenance and expansion that may be required with the project (something I should have thought about before, I know). I have been doing a bit of research and looking into using the Zend MVC rather than the basic structure as it appears this would help to remedy that fear. However, it would mean a lot of backtracking in the project (not a huge deal, just a little frustrating).

What I'm wondering is if there are any other reasons why I should take the time to switch away from the basic structure over to an MVC architecture, or if there are any other file structures I should be considering?

+2  A: 

The first reason is that MVC has been shown to be effective in being able to maintain your code.

http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller

The second reason, which I believe is part of the first one, is that it allows developers to come in behind you and already know what the basics are. Instead of searching through your project and trying to find out how it works, they already know.

I might suggest Kohana as a good framework to use. http://kohanaphp.com

Brandon Hansen
Thanks for the response. Is there any sort of added security that comes from using MVC?
munch
Not really inherently, but this usually does cause your application to utilize a single entry point. In that single entry point you can define a constant, and then in the top of each file you can add something like this- if(!isset(ENTRY_POINT)) die('No direct access');That way you can make sure that your app can go through the bootstrapping and run all of its security. It will just be a lot more solid.
Brandon Hansen
A: 

principe of MVC is very useful. [C]ontroller gets data from the datebase named [M]odel, changes it, and outputs everything to the [V]iew. In cakephp, if you know which action do you need to edit, you surely know where to search it, to open and edit. it's about Structure.

I might suggest Cakephp. http://www.cakephp.org

Aziz
+1  A: 

Zend is very good Framework. with a lot of classes.

IMHO: But it's more Class library, than Framweork.

Aziz