I am new to php frameworks, it is said that php frameworks provide reusable code, more than code written in flat php, but in most php frameworks we write code in 3 sections like models, views, controller etc.
How that code is reusable, in another projects?
In flat php, we write code in one function and we can use it anywhere.

Recommended Answers

All 4 Replies

You need to study object-oriented design and development a LOT more before you can deal with this. Consider PHP to be C++ for web programming. In any case, the answer to your question would require a 500 page book to cover in detail... :-(

In addition: check also about composer, it's a dependency manager for PHP, most frameworks support it and it allows to easily share and include libraries into a project:

However you don't really need to use a framework to take advantage of composer, you can use flat PHP. A part that a framework can be useful because it provides a defined and tested structure.

Frame work is easy to understand codes.how you created ..and MVC frame work having inbuilt library and helpers functions,you can save your time by just calling the functions, .but you should aware about OOPs concepts.and reusable is depends on projects..i mean CRUD operation is same means you can just dump that code to your another projects..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.