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

PHP Development

Hello,

I have been doing some PHP courses that you offer and have come across two different methods when creating a PHP website. There is the course instructed by Hampton Paulk which shows you to use some frameworks such as twig to create templates for your website. Then there is Building a simple PHP application which doesn't use any frameworks but can achieve the same affect as Twig with variables and the code line include.

My question is, which is industry standard? Are there benefits to using one over the other, if yes what are these? Should it be included in all website you build?

1 Answer

Every company is going to have their own take on what is considered "standard". Typically there will be a tool or framework that is more widely used, and that will be what most people use as there is going to generally be better documentation on it.

The best thing you can do for yourself as a developer is always make sure you are using the right tool for the right job. This is why it is so important to know what is out there, and really understand what the code is doing. Sometimes you'll see people using a framework even when they are writing simple php based website templates, other times you'll have people writing complex API's when something like SLIM would easily do the trick.

Each framework is going to have something it does differently, and sometimes better. Being able to work with and understand any framework can help a lot but at the end of the day you have to ask the right questions about your project to determine which tools you are going to use.