Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Jeremy Ting
Jeremy Ting
303 Points

(WebDev) Guidance on frameworks?

Does treehouse have any resources at hand that will help users tie together their knowledge of a language to a framework in order to create a web app?

in my special case, i know the basics of php and my sql, and i know in order to take the next step to build something, i would need to know how to use a framework like codeigniter. but i have absolutely no idea where to start!

8 Answers

Randy Hoyt
STAFF
Randy Hoyt
Treehouse Guest Teacher

Hey Jeremy,

Ryan and James are right: you don't need a framework to build an application with PHP. But they can be really helpful. They speed up development, and they allow you to focus on more interesting and unique parts of your application. Quite a lot of professional web development is done with an MVC framework, and I think learning how to work with one will make development more interesting and will be good for your professional development.

It sounds like I'd recommend starting with a framework a little earlier than James would, but we both definitely agree that you should have a good handle on the basics. Take a look at these six questions; if most of them are obvious/easy for you to answer, then I'd recommend starting with a framework:

  1. What does the HTML tag form do? What are its action and method attributes for?
  2. What is the difference between POST and GET variables? If I wanted a particular view of a page to be able to be bookmarked, which one would I use?
  3. What's the difference between a variable, an argument, and a property? Which of them applies to a function? Which one applies to an object?
  4. What are the different types of HTTP header redirects? What is the difference between a 301 and a 302?
  5. Visiting a web address like /books/edit/10 should load a file called books.php and load "edit" into a variable named $action and "10" into a variable named $id. How is that possible?
  6. What's a SQL injection attack? How would you avoid it?

The tutorial I personally found most helpful when I first coded an application with an MVC PHP framework was an older version of this one: CakePHP > Blog Tutorial. It should take 30 minutes or so, and after that you'll get a feel for what it's like to work with such a framework.

Hi Jeremy

Yes, a great place to start is with this project: http://teamtreehouse.com/library/programming-2/build-a-simple-php-application

Best, Ryan

Jeremy,

You don't need to use a framework in PHP to build a product. Yes, there are several popular ones, but it isn't necessary.

I'm happy to be convinced by a PHP expert though.

Ryan

Jeremy Ting
Jeremy Ting
303 Points

thanks for the response!

James Barnett
James Barnett
39,199 Points

Frameworks solve a particular problem, those most commonly associated with large sites. Before you look at a framework it would probably be best to build an app or two using PHP.

James Barnett
James Barnett
39,199 Points

@Randy - What a brilliant idea, asking questions so people can judge if they are ready to move to the next level in their professional development.

An inspired idea!

Jeremy Ting
Jeremy Ting
303 Points

thanks randy! love the PHP shop-app tutorial

Randy Hoyt
STAFF
Randy Hoyt
Treehouse Guest Teacher

Glad you are enjoying them, Jeremy! :~) I'm now working on the content for the next phase of that project: we'll be improving the code and adding some new features to it.