PanelAdminという名前の管理パネルプラグインがあります。 私が直接PanelAdminを呼び出すために、それは上記の図を示しているが、今、私必要がありますしたいテンプレート/トピックス/ index.ctpcakephpのURLからプラグインコントローラを呼び出す方法3
<h1>Blog topics</h1>
<p><?= $this->Html->link('Add Topic', ['action' => 'add']) ?></p>
<table>
<tr>
<th>Id</th>
<th>Title</th>
<th>Created</th>
<th>Actions</th>
</tr>
の内側に見るこれは、これはトピックであるCategoriesController.php
<?php
namespace PanelAdmin\Controller;
use Cake\Controller\Controller;
use Cake\ORM\TableRegistry;
class CategoriesController extends AppController
{
public function initialize()
{
parent::initialize();
$this->loadComponent('Flash'); // Include the FlashComponent
}
public function index()
{
$this->set('topics', $this->categories->find('all'));
}
}
?>
ですそれは私がhttp://localhost/multi_shopping/PanelAdminこのURLを打ったとき、それは、プラグインフォルダに検索したいメインのsrcフォルダ内の検索
Error: CategoriesController could not be found.
:次のエラーを得ました。
として、あなたのコントローラがアクセスできるようになります、URLにプラグインコントローラにアクセスするには、プラグイン内のルートを定義する必要はありませんプラグインPanelAdminのroutes.phpファイルまたはメインのroutes.phpファイル – user3653474