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

TeamTreehouse Badge Script, am I doing it right?

I've just created a little PHP script (kinda my first one) to display Information using TeamTreehouse's JSON feed (eg. displaying Badges).

But sadly I'm not sure if I've got all that MVC stuff completly right and if I could improve the script itself or functionality of the script. I'd appreciate any tips and hints you have!

https://github.com/InitArt/TeamTreehouse-Badges

1 Answer

Eike, I looked over your code and everything looks good to me. You might consider building a static method for your class the calls the different views files based on a string. Something like :

class::display_badges("random:);
class::display_badged('all');
class::display_badges('latest');
class::display_badges('limit', 10);

I think something like that might be helpful for people using your script

Hey Andrew, thanks for your advice! I'm definitely going to look into this.