Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Photo Grading System (grading from 0-10)
I am developing an app that enables a user to upload a picture and then have it graded by a different user.
When viewing a photo, I would like to get the list of the appropriate criteria in a list.
Sections (or locations)
Each photo belongs to a section.
Each section has different grading criteria.
The photo table has the folowing fields:
The criteria table fields:
The section table fields:
// Inside Template/Photos/view.ctp
<?php foreach ($criterios as $criterio): ?>
<div><?= h($criterio->nombre) ?></div>
<?php endforeach; ?>
// FotosController
public function view($id = null)
$foto = $this->Fotos->get($id, [
'contain' => ['Tiendas', 'Sections', 'Users', 'Clientes']
$this->set('foto', $foto);
$sections = $this->Fotos->Sections->find('list', ['limit' => 200]);
//$criterios = $this->Sections->Criterios->find('list', ['limit' => 200]);
// $criterios = "99";
$criterios = $this->Sections->Criterios->find('list', ['limit' => 200]);
$this->set('_serialize', ['foto']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.