上著書の456ページ
プラグインのサンプルにて止まっています。
1.bootstrap.phpに plugin::routes();
2.sqliteに PersonalDatum のダミーデータを作成
3.bin\cake bake plugin PersonalDatum を実行
4.モデル作成(エンティティ・テーブル割愛)
5.コントローラー作成
plugins\PersonalDatum\src\Controller\PersonalDatumController.php
<?php
namespace PersonalDatum\Controller;
use Cake\Event\Event;
use Cake\Network\Exception\InvalidCsrfTokenException;
use Cake\ORM\TableRegistry;
//use PersonalDatum\Controller\AppController;
class PersonalDatumController extends AppController {
public function index() {
$data = $this->PersonalDatum->find('all');
$this->set('data',$data);
}
}
6.index.ctp作成
(Plugin\PersonalDatum\src\Template\PersonalDatum\index.ctp)
7.bootstrap.php に追記
Plugin::load('PersonalDatum', ['bootstrap' => false ,'routes' => true]);
8.http://localhost/yyy/xxx/personal-datum/personal-datum/
にアクセス
Missing Controller
Cake\Routing\Exception\MissingControllerException
Error: PersonalDatum.PersonalDatumController could not be found.
Error: Create the class PersonalDatumController below in file: C:\xampp\htdocs\yyy\xxx/plugins/PersonalDatum/src\Controller\PersonalDatumController.php
と、本の通りに実行したのにエラーが表示されます。
どこが間違っているのでしょうか?
ご指摘をおねがいします。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/07/01 10:20