PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Wed Jun 28, 2017 10:37 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Tue Jun 29, 2010 4:46 am 
Offline
Forum Contributor

Joined: Mon Jun 29, 2009 4:13 am
Posts: 217
Location: India
Hai i have done one of my php project in online collabritaion in education with 40 center. here i have used simple php code not typical. its working fine no problem. but i saw and reads most of the articals programmer are used MVC. i had read about mvc .but some are used zend framework some people are used cake php some are used zamp .
i have some query like
1- why we used MVC any security type problem in simple php code.?
2-which is the best framework in zend,cakephp or zamp.
3-Pl write more about MVC.


pl clear the doubt.

thanks.
Manoj


Top
 Profile  
 
PostPosted: Tue Jun 29, 2010 3:10 pm 
Offline
Site Administrator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 13411
Location: New York, NY, US
MVC is a way to provide some clean separations in your code to promote reuse. You can create secure applications in PHP with or without MVC. For frameworks, they are all free so download and try them to see which best fits you.

_________________
(#10850)


Top
 Profile  
 
PostPosted: Wed Jun 30, 2010 6:11 am 
Offline
DevNet Master

Joined: Wed Feb 11, 2004 4:23 pm
Posts: 4872
Location: Palm beach, Florida
"Normal" top to bottom code is 1 tier. All code is in 1 file that gets run*.

* technically you could use includes but the idea is the HTML + logic is all mixed together.

Next level up is 2 tier is when you separate out the HTML out from the PHP code. This allows you to use different templates. Next level up is 3 tier where you have a Controller+Model. For example if you were a banking site your "Controller" would have actions like (deposit, withdraw). The "Model" would be the bank account itself, some sort of object, array or variable that represents how much money is in the account. The concept of the "transaction" is another Model. Models are implemented as objects, arrays, etc...

So 2 tier lets you use multiple templates with a single application. Or multiple applications running the same code all with different look + feel.

3 tier lets the programmer re-use code from "action" to "action". So if you have lots of "actions" in your application, you aren't copy & pasting code. That's really what it comes down to. It saves you a lot of copy & pasting. Copy & pasting is the root of all evil in programming because your code becomes bloated.


Top
 Profile  
 
PostPosted: Wed Jun 30, 2010 11:39 pm 
Offline
Forum Contributor

Joined: Mon Jun 29, 2009 4:13 am
Posts: 217
Location: India
Thanks to give nice information. Which type of project we have to take in MVC style.


Top
 Profile  
 
PostPosted: Thu Jul 01, 2010 8:42 am 
Offline
DevNet Master

Joined: Wed Feb 11, 2004 4:23 pm
Posts: 4872
Location: Palm beach, Florida
MVC will work on anything, a guestbook application for example. I suggest just sitting down and spending a weekend doing some tutorials. Google for "MVC tutorials".


Top
 Profile  
 
PostPosted: Fri Jul 02, 2010 8:29 am 
Offline
Forum Contributor

Joined: Mon Jun 29, 2009 4:13 am
Posts: 217
Location: India
Thanks
Ya i had tried to download but its give full and lengthy tutorial i need small tutorial so that i can easily understand if u have pl provide to me. in my mail id manojsemwal1@gmail.com

one more think i want to know in joomla and drupal etc. all are customization software in there developer are coded in bounded or not or he will work independently.

Thanks


Top
 Profile  
 
PostPosted: Fri Jul 02, 2010 10:21 pm 
Offline
DevNet Master

Joined: Wed Feb 11, 2004 4:23 pm
Posts: 4872
Location: Palm beach, Florida
Here is a link to a tutorial. I don't understand the rest of what you're asking. http://framework.zend.com/manual/en/lea ... intro.html


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group