O
O
Oleg2015-03-12 04:13:23
PHP
Oleg, 2015-03-12 04:13:23

CakePHP - how to get data correctly?

Suppose:

  • i have a city
    • which has schools
      • which have classes
        • in which there are students

How to get the whole thing right, provided that the links in the models are registered and must be displayed on one page?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg, 2015-03-12
@LastDreamer

I figured out
the City model
in the controller myself

$cities = $this->City->find('first'
    'contain' => array(
        'Schools' => array(
            'Classes' => array(
                				'SchoolsKids'
             )
        )
    	)
);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question