Jump to content

What is a PHP framework and how do they work?


Bman900

Recommended Posts

So I tried searching this on google and it only got me more confused. Can some one explain what a PHP framework is and how it effects a PHP developer?

 

Basicly is it a way you write code or is it a giant script where you built off of from? Sorry for the extremly stupid questions but am just curious.

Link to comment
Share on other sites

Ok, so I found a nice sideshows that helps you set up the framework but from what I see you need to mess with php.ini some root server stuff and mod_rewrite. Is this framework able to be run on a shared host or must have a dedicated server?

Link to comment
Share on other sites

Is this framework able to be run on a shared host or must have a dedicated server?

 

You should have no problem using Zend framework on shared hosting. You will need the ability to write .htaccess files though (which all Apache hosting should provide).

Link to comment
Share on other sites

When you make a web application, you usually don't do (or at least - you shouldn't do) everything from scratch. Some parts of the code are very similar across the application, and you can see that you write many things in a very similar way. If you take this "shared" code and design concepts you are using and make a reusable library from it, you get a framework. Then you can put it into your new project and speed up it, because many parts are already done and ready to use. Of course, most of such home-made frameworks will simply suck, especially if you have no experience, but technically speaking they are still frameworks.

 

The idea of "professional" frameworks is similar, but of course they are well-designed, well-tested, flexible and provide lots of features for different purposes. They give you pieces of a complete code, tools, automatic code generators and some techniques and you build a web application using them, just like building a house from ready bricks.

 

PS. I would not recommend Zend Framework if you are a beginner. It's quite complex and requires much more from the programmer to set up the basic application structure.

Link to comment
Share on other sites

 

PS. I would not recommend Zend Framework if you are a beginner. It's quite complex and requires much more from the programmer to set up the basic application structure.

 

Man I wish you were here 2 days ago cause I tried Zend and I only got more confused and mad cause I had no idea what I was doing. I was always writing everything from scratch before so I have no experience in any framework. What framework would you recommend?

Link to comment
Share on other sites

What is your experience with object-oriented programming and design patterns? Actually, it's quite hard to say which framework is easy and which is not. People have different preferences and it simply depends. Note that many people would recommend you the framework they use, but they may be professionals and write from their point of view. However, I'll try to describe you something...

 

Kohana is relatively simple, but it has very poor documentation and tutorials which may be a problem. Yii Framework has quite a lot features, but I think it is also quite easy for the beginners. It comes with the ready-to-use application skeleton and code generators that generate the basic, primitive web application which you simply have to fill with your content. Unless you try to make sophisticated hacks, it should be OK.

 

Anyway, before you start, read something about design patterns and MVC (Model-View-Controller), becuase these techniques are very popular in frameworks and will help you understand, what's going on. Just a small note here that most of the frameworks does not actually implement MVC (even if they write they do), but something called MVP (Model-View-Presenter), so don't be confused if you will find differences between practice and theory, like I was for two years :).

Link to comment
Share on other sites

 

PS. I would not recommend Zend Framework if you are a beginner. It's quite complex and requires much more from the programmer to set up the basic application structure.

 

Man I wish you were here 2 days ago cause I tried Zend and I only got more confused and mad cause I had no idea what I was doing. I was always writing everything from scratch before so I have no experience in any framework. What framework would you recommend?

 

I'm not touching any frameworks at all for atleast another year.

Link to comment
Share on other sites

I learned to design websites without the use of Frameworks back in the day; but as I learned more, and did more sites; I ended up having a respository of classes that I would need; and essential classes, that made my life as a coder easier.  I then tried cakePHP and other frameworks, figuring out that; throught out my years of programing, i ended up creating my own personal framework that hasn't failed me yet :)

 

Frameworks make coding somewhat a little faster for the traditional coder, and can prove to be quite efficient. 

For example I am currently working on a site that is built of a Moodle Build.  Within their framework they have the function get_records($table, $searchfield, $serachvalue, [$limit]);

 

which takes care of querying the database, returning the value, and then run a foreach on all the rows, and returns them into an object.

 

Its saves me ton of time and I dont have to repeat the same code over and over again.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.