Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.