public function view($id = null) {
$query = $this->fetchTable(‘Users’)->find()->matching(‘Bios’, function ($q) use ($id) {
return $q->where([‘Bios.user_id’ => $id]);
})
->contain(["Bios", "Surveys","Recipes", "Urls"])
->matching('Bios')
// ->matching(‘Surveys’)
// ->matching(‘Recipes’)
->all();
$this->set(compact('query'));
}
SCREENSHOTS OF ONE USER THAT HAD NO RECIPES AND ONE USER THAT HAD 4 RECIPES
Screenshot\ from\ 2026-04-26\ 11-52-21.png
Screenshot\ from\ 2026-04-26\ 11-52-32.png
THE BOOTSTRAP CODE IS VERY CORRUPTED BUT I JUST WANT TO SEE THE OUTPUT OF THE query LOOP
<h2><?php
foreach ($query as $q):
///you shouldn't need to do this because the join is on id = user_id
if ($id == $q->bio-> user_id):
echo $q → contributor; ?
>
<?php
if ($q → bio->home_page_image != NULL ){
echo “PICTURE HERE”;
//echo $this->element(“homepageimage”, [“bio” => $q->bio]);
?>
LINE 69 <?php
} if ($q->survey->publish == 0 && !empty($q->bio->body)) {
//echo $q->bio->body;
echo “BIO BODY”;
?>
Date This Bio Was Created: <?php $date = $q->bio->created; echo date_format($date, 'F jS, Y'); echo "
"; } elseif ($q->survey->publish == 1) { //COMMENT BACK IN LATER //echo $this->element("survey", ["survey" => $q->survey]); ?>Date This Survey was taken: <?php $date = $q->survey->created; echo date_format($date, 'F jS, Y'); ?>