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 Building Websites with PHP Slim Basics & Twig Templates Layouts with Twig

[SOLVED] Layouts with twig

I have completed the 'Building websites with PHP' section. I am still a little confused. I followed the videos 4 times and I am still not sure where the '.html' files connect to the '.twig' files. For example, once the project is complete and you hover over the 'About' and 'Contact' links, the web address follows to '/about.html' and '/contact.html', respectively but we deleted those files in favor of the twig files so clicking the links lead to a broken link and on my server(1&1 hosting) it leads to an internal 500 error. Where am I going wrong?

3 Answers

It really does help to remember what you've learned. I completely forgot about named routes and the helpers(baseUrl, urlFor, etc.) Whew! I can go on with my learning again.

jason chan
jason chan
31,009 Points

Did you upload all the files to 1&1 ftp including the twig package? Because it is a composer package?


You might need vps instead of shared hosting because you have to use composer install the commandline to download the twig package.

Hello Jason, thank You for your response. I did all the initial training on my local machine and I transferred everything to my 1&1 hosting. I am able to install composer and all the dependencies required of the training via SSH on my shared hosting but my only hang-up is that I can't get it to lead the About and Contact sections to their respective pages. the url to my site is www.coreycarter.net, if seeing what I mean helps me explain it better. Thank You for any insight you have.

Hello corey carter..im sorry but this is not a answer for ur question. I am looking for project team members to work on my projects. Right now my team consists of only 3 people including me and i would really like you to join me :) .

My team is now working on an existing project of mine and trying to improve it to the maximum we can but after 18th of this month we are planning to build a social networking website. If u are interested....email me at lakindu1.jayathilaka@gmail.com or https://www.facebook.com/lakistealthhacker

thanks have a good day