how to make own model in cakephp3

my controller — (path /src/Controller/DemoController.php)

<?php

namespace AppController;

class DemoController extends AppController
    {

public function image()
    {
        $this->loadmodel('Get');
        $result = $this->Get->get_data();
        $this->set('user_data',$result);
    }
}

My model — (path /src/Model/get.php)

<?php
namespace AppModel;

class Get extends AppModel {


public function get_data()
    {
        return $this->query("select * from registration ");
    }

}
?>

after doing this it`s get an error like in below image please tell me how to make my own function , query in cakephp3 model..enter image description here


Source: php

Leave a Reply