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

Seth Warner
Seth Warner
5,348 Points

now when he said "hero" is that the name you MUST use for IMG files or is the picture just a picture of a "Heroe".

Could I just name it {% block img %}

? or perhaps {% block img_1 %}

encase I have multiple img in the html template, i wish to modify differently?

Seth

4 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

With the exception of the challenges (which are very specific and picky), naming is entirely up to you.

As long as your files and your code is using the same file names, you can name them whatever you want. However, if you are following along with the teacher (either in workspaces or in your own editor), I have found it smart to name things the way he/she names things. This is not required, but makes it much easier to follow along with the teacher as the course and code progresses.

Hope that helps! :)

Seth Warner
Seth Warner
5,348 Points

Awesome, thank you! I was just wanted to confirm "hero" was not syntax. PLEASE check out my second question I just asked pertaining to this video!!!

Seth

Jason Anders
Jason Anders
Treehouse Moderator 145,860 Points

Hey Seth,

It's been a bit since I've done Slim and Twig in PHP, so I don't feel confident in providing an answer for your other question. I'm sure there are other students in the forum that will be able to help you with that. :)

Elena Paraschiv
Elena Paraschiv
9,938 Points

{% block hero img %} If we add img after hero will the syntax be good, meaning if there are 2 words (of whatever choice) after block will the results be the same?

Jason Anders
Jason Anders
Treehouse Moderator 145,860 Points

Hi Elena,

Generally in naming conventions, you don't want to have a space between the names. This can cause big problems in many different situations and languages. Instead, I would use a dash (-) or underscore (_) to separate the names. So, in your example, your could do hero-img or hero_img. Sometimes it's just a personal preference, but sometimes it is specified by the syntax what can and cannot be used. If ever unsure, you can always check documentation or Google to see if a dash or an underscore or either/or should and can be used.

:)

Seth Warner
Seth Warner
5,348 Points

I agree with jason :p