Apache,MySQL start
Database:mydata
Table:people
<?php
namespace App\Model\Table;
use Cake\ORM\Table;
class PeopleTable extends Table{
public function initialize(array $config){
$this->setTable('people');
$this->setDisplayField('mail');
$this->setPrimaryKey('id');
}
}
?>
<p>This is People table records.</p>
<pre>
<?php print_r($data->toArray()); ?>
</pre>
<?php
namespace App\Controller;
use App\Controller\AppController;
class PeopleController extends AppController{
public function index() {
$id = $this->request->query['id'];
$data = $this->People->get($id);
$this->set('data', $data);
}
}
?>