PHP Designing Interfaces in PHP Using Interfaces Testing for Interfaces

Mister Moody
Mister Moody
38,289 Points

Interface Implodes during Testing

Having troubles understanding how the entire site fell apart after I began testing interfaces. Once I updated the list.php, share.php, track.php, single.php files, details from the database.json file were omitted and the function that allowed single-items to expand no longer functioned as constructed.

I deleted all new code for this particular video, and everything worked fine. Because I included my own CSS I will review <html> tag placement to ascertain if that could be the culprit, but this is one of those 'f*#$' me moments where I have double-checked typos and rewatched the entire series only to realize that I'm in big trouble.

You can view a snapshot of the project for analysis.

Thank you in advance.

1 Answer

Ben Payne
Ben Payne
1,464 Points

Hey Mister Moody - Have a look at views/track.php line 3:

<?php echo $content-getAuthor(); ?>

Also, take a look at src\classes\jsonRepository line 23:

<?php
//
public function find($entity, $value, $field = 'id')
{/* LOOP through json File Items */
    foreach ($this->all($entity) as $key=>$data) {
        /* LOAD 'json' File */
        if ($data->field == $value) { // THIS LINE IS MISSING AN IMPORTANT CHARACTER ;)
            return array($data);
        }
    }
}

Hopefully that helps.

Cheers,

Ben

Mister Moody
Mister Moody
38,289 Points

Thank you for your assistance Ben. That single omission of the > character was indeed the culprit, and all systems are functioning as intended! I have different working copies for this project; one using the teachers CSS and one where I am implementing my own styles that incorporates a grid layout and it is causing me some fuss, but all is good in my world for the weekend thanks to your help!