【发布时间】:2017-11-11 17:54:52
【问题描述】:
我有一个名为 PanelAdmin 的管理面板插件。 这是 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'));
}
}
?>
这是 Template/Topics/index.ctp 中的主题视图
<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>
我想直接调用 PanelAdmin,它应该显示上面的视图,但现在我收到以下错误:
Error: CategoriesController could not be found.
它在主 src 文件夹中搜索,我希望它在我点击 http://localhost/multi_shopping/PanelAdmin 这个 url 时搜索到插件文件夹。
【问题讨论】:
标签: cakephp cakephp-3.0