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 Object-Oriented PHP Basics Building the Recipe Static

don't understand this question.

<?php

class Render { public static function displayDimensions($size){ return $size[0] ." x ". $size[1]; }

public static function detailsRoom($room){

}

public function getName(){

}

}

?>

index.php
<?php

class Render {
    public static function displayDimensions($size){
        return $size[0] ." x ". $size[1];
    }

    public static function detailsRoom($room){

    }

    public function getName(){

    }
}

?>

1 Answer

Phil Livermore
Phil Livermore
11,018 Points

As with quite a few of the tasks it is quite difficult to understand what is required.

The getName and getDimensions methods are already defined for you so you just need to call these in the appropriate place.

From the detailsRoom function you need to return a string to match this layout: "name Dimensions: length x width".

Name is populated by calling the getName method and length x width is populated by calling the getDimensions method. You will need to use the $room property in both.

Hopefully that is a bit clearer so you can have a go at answering yourself.