CakePHP访问插件控制器


CakePHP Accessing Plugin Controller

好的,所以我使用的是ReportManager插件。我可以使用这个url: 'localhost/AppName/report_manager/reports'

现在,当我试图在我正在工作的项目上使用它时,我有一个访问插件控制器的问题。

我有一个侧栏,其中包含几个链接。下面是代码:

<div id="wrapper">
    <!-- Sidebar -->
    <div id="sidebar-wrapper">
        <ul class="sidebar-nav">
            <li id="sidebar-header">
                <?php
                    echo $this->Html->link(
                    'Home',
                        array(
                        'controller' => 'members',
                        'action' => 'index',
                        )
                    );
                ?>
            </li>
            <li id="sidebar-header">
                <?php
                    echo $this->Html->link(
                    'Messages',
                        array(
                        'controller' => 'members',
                        'action' => 'messages',
                        )
                    );
                ?>
            </li>
            <li id="sidebar-header">Misc</li>        
            <li>
                <?php
                    echo $this->Html->link(
                    'Received Documents',
                        array(
                        'controller' => 'members',
                        'action' => 'documents',
                        )
                    );
                ?>
            </li>
            <li id="sidebar-header">
                <?php
                    echo $this->Html->link(
                    'Calendar',
                        array(
                        'controller' => 'calendars',
                        'action' => 'calendar',
                        )
                    );
                ?>
            </li>
            <li>
                <?php
                    echo $this->Html->link(
                    'Manage Events',
                        array(
                        'controller' => 'events',
                        'action' => 'manage',
                        )
                    );
                ?>
            </li>
            <li id="sidebar-header">
                <?php
                    echo $this->Html->link(
                    'Reports',
                        array(
                        'controller' => 'reports',
                        'action' => 'index',
                        )
                    );
                ?>
            </li>
            <center><hr class="item-divider"></center>
            <li id="sidebar-header">
                <?php
                    echo $this->Html->link(
                    'Manage Accounts',
                        array(
                        'controller' => 'members',
                        'action' => 'manage_accounts',
                        )
                    );
                ?>
            </li>
            <li id="sidebar-header">
                <?php
                    echo $this->Html->link(
                    'Logout',
                        array(
                        'controller' => 'user',
                        'action' => 'logout',
                        )
                    );
                ?>
            </li>
        </ul>  
    </div>
</div>

所以我有一个链接名称'Reports',将打开ReportsManager插件。到目前为止,我还不知道如何访问它。

我试了这个:

<li id="sidebar-header">
      <?php
          echo $this->Html->link(
         'Reports',
            array(
              'controller' => 'report_manager/reports',
              'action' => 'index',                          
                 )
          );
       ?>
 </li>

它工作,但一旦你点击其他链接,你会看到这个url: 'localhost/AppName/report_manager/members/documents'

有什么办法可以解决这个问题吗?

添加'plugin' => 'plugin NAME HERE'

<li id="sidebar-header">
  <?php
      echo $this->Html->link(
     'Reports',
        array(
          'plugin' => 'report_manager',
          'controller' => 'reports',
          'action' => 'index',                          
             )
      );
   ?>

其他链接'plugin' => false

<?php
    echo $this->Html->link(
      'Home',
       array(
          'plugin' => false,
          'controller' => 'members',
          'action' => 'index',
       )
    );
?>