<file_sep><?php

namespace App\Controller;

use Cake\Controller\Controller;

class BooksController extends Controller {


     public function index () {
        
        $books = $this->Books->find()->fetchAll();

        $this->set('books', $books);

        $this->render('index');


     }   



}<file_sep><?php

var_dump($books);<file_sep># sebo-rural-cakephp<file_sep><?php

namespace App\Controller;

use Cake\Controller\Controller;

class CoursesController extends Controller {

    public function initialize()
    {
        parent::initialize();
        $this->loadComponent('RequestHandler');
    }


    public function index () {
        $courses = $this->Courses->find('all');

        $this->set('courses', $courses);
        $this->set('_serialize', 'courses');
    }

    public function view($id)
    {
        $course = $this->Courses->get($id);
        
        $this->set('course', $course);
        $this->set('_serialize', 'course');

    }

}<file_sep><?php

namespace App\Model\Table;

use Cake\ORM\Table;

class BooksTable extends Table {

}