开发者

Getting started with PHP / MVC [closed]

开发者 https://www.devze.com 2023-03-03 14:40 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 6 years ago.

Improve this question

i have been using PHP for quite a sometime now, having understood the concept of OOPS, PDO, etc. i have been slowly moving forward to more advanced PHP. my strategy is always to learn more and more advance programming in every project. for my current project i would like to implement MVC, as i have been implementing my own directory o开发者_JAVA技巧r application structure before, this time i want to use MVC for my application. i did went through a MVC boilerplate tutorial on Nettuts. however that was just the basic i am searching for more and more resources for me to help get started with MVC for my projects. i am sure you guys might have passed from the same path i would like to know the links and suggestion about some of the great MVC tutorial for PHP available in the internet.

EDIT :

I have used frameworks like cakephp before i would request not to suggest using of any framework.

thank you


I would suggest you look at the MVC Design Pattern so that you understand it before you start using it.

Ideally, you should already have made some projects where you suffered a little bit because you wanted to change stuff when your project was at least halfway done.(This is one of the main motivators behind a lot of so-called advanced programming techniques. Ease of modification, flexibility and so on).

This is where stuff like what you mentioned (OO,MVC, and I would add TDD, Design Patterns) all come in).

What I do for myself and suggest others do is the following. Look into whatever you want, be it TDD, MVC or any other advanced technique. But wait until you need them.

In my personal opinion, one can much better appreciate the value of OO and MVC when one has gone through a naïve project and suffered from lack of functionality these techniques provide...

The golden rule is.. only start using a new technique when you've understood it and seen what benefits it can bring.

I say that because what I see in real life is that many people use stuff like OO, MVC and even Design Patterns without understanding the why's behind. I don't think that helps at all.

Good luck.


I strongly suggest you to take a look into Kohana framework. Its an HMVC framework, with cascading directory structure. If you are looking for books on advanced topics, "PHP Objects, Patterns, and Practice" by Matt Zandstra describes very well about Design patterns in PHP. "Pro PHP Patterns, Frameworks, Testing and More" is also an excellent book which discuss about many advanced topics.


That tutorial discusses implementing one's own MVC framework. You can use an existing framework to implement applications using the MVC paradigm. I happen to prefer Zend for this. Here is a tutorial on using Zend MVC Framework:

http://framework.zend.com/manual/en/learning.quickstart.intro.html


You can try to start with Yii it easy to lear and use: http://www.yiiframework.com/tour/


To get my mind around the concept, I found a lot of reading to be helpful as well as seeing it implemented from scratch. Several resources:

Book Resource: PHP In Action, pages on MVC. (Great because mentions the difference between application and web MVC).

Understanding the Concept: http://www.cs.cmu.edu/~pattis/15-1XX/15-200/lectures/modelinmvc/

Build Your Own Tutorial: http://net.tutsplus.com/tutorials/php/create-your-first-tiny-mvc-boilerplate-with-php/

Build Your Own Tutorial, more complex: http://www.nathandavison.com/posts/view/11/custom-php-mvc-tutorial-part-1-introduction

0

精彩评论

暂无评论...
验证码 换一张
取 消