国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

錯(cuò)誤:'您的應(yīng)用程序類(lèi)沒(méi)有 bootstrap() 方法。請(qǐng)?zhí)砑右粋€(gè)。”
P粉872182023
P粉872182023 2024-02-21 16:16:00
0
1
777

我最近開(kāi)始使用 CakePHP 4.X 在本地構(gòu)建一個(gè)應(yīng)用程序。我安裝了 Composer 并使用它成功安裝了 CakePHP 身份驗(yàn)證和授權(quán)插件?,F(xiàn)在,我正在嘗試轉(zhuǎn)向一些社區(qū)開(kāi)發(fā)的插件,例如

  • https://github.com/FriendsOfCake/bootstrap-ui
  • https://github.com/gutocf/page-title
  • https://github.com/dereuromark/cakephp-feedback

我可以安裝所有插件,但是當(dāng)我嘗試加載插件時(shí)出現(xiàn)問(wèn)題。根據(jù)每個(gè)插件 Git 頁(yè)面上的說(shuō)明,我嘗試使用以下行從 CLI 加載插件

bin\cake plugin load BootstrapUI

(我使用的是 Windows,因此使用反斜杠)

在所有情況下我都會(huì)收到以下消息:

Your Application class does not have a bootstrap() method. Please add one.

我的src/Application.php文件如下所示

class Application extends BaseApplication
public function bootstrap() : void
{
    // Call the parent to `require_once` config/bootstrap.php
    parent::bootstrap();

    if (PHP_SAPI === 'cli') {
        $this->bootstrapCli();
    } else {
        FactoryLocator::add(
            'Table',
            (new TableLocator())->allowFallbackClass(false)
        );
    }

    /*
     * Only try to load DebugKit in development mode
     * Debug Kit should not be installed on a production system
     */
    if (Configure::read('debug')) {
        $this->addPlugin('DebugKit');
    }

    // Load more plugins here
    $this->addPlugin('Authorization');
    $this->addPlugin('Authentication');
    $this->addPlugin('BootstrapUI');
    
}

P粉872182023
P粉872182023

全部回復(fù)(1)
P粉198670603

您的應(yīng)用程序類(lèi)在 class Application extends BaseApplication 之后缺少 {,但我猜它在此處粘貼/編輯不正確。

您的命令似乎有效,因?yàn)槲铱吹讲寮?$this->addPlugin('BootstrapUI') 已添加到文件中。

執(zhí)行 CLI 命令時(shí),請(qǐng)確保位于正確的路徑(在應(yīng)用程序的根目錄中):

bin\cake plugin load BootstrapUI

您可以在 bootstrap() 方法中手動(dòng)添加插件,無(wú)需 CLI。

最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板