首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Plugin cakephp 3.7

Plugin cakephp 3.7
EN

Stack Overflow用户
提问于 2019-05-26 23:48:43
回答 1查看 1.7K关注 0票数 1

如何通过远程文件夹将插件映射到cakephp 3.7中?

在版本3.4之后,我不再能够加载插件,我查看了文档,并检查它是否已经使用Application ::addplugin ()和Application ::bootstrap ()进行了更改;这是我找到的解决方案,我不知道是否需要执行更多的过程,或者其他语法是否已经改变。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-05-27 07:36:22

来自CakePHP文档:

插件外壳允许您通过命令提示符加载和卸载插件。如果您需要帮助,请运行:

代码语言:javascript
复制
bin/cake plugin --help

加载插件 通过Load任务,您可以在config/bootstrap.php中加载插件。您可以通过运行以下命令来做到这一点:

代码语言:javascript
复制
bin/cake plugin load MyPlugin

这将将以下内容添加到src/application.php中:

代码语言:javascript
复制
// In the bootstrap method add:
$this->addPlugin('MyPlugin');

// Prior to 3.6, add the following to config/bootstrap.php
Plugin::load('MyPlugin');

如果在引导中的任何方法/事件之前需要插件,请使用以下命令:

代码语言:javascript
复制
class Application extends BaseApplication
    {
        /**
         * {@inheritDoc}
         */
        public function bootstrap()
        {
            $this->addPlugin('OAuthServer', ['routes' => true]);

            // Call parent to load bootstrap from files.
            parent::bootstrap();

            if (PHP_SAPI === 'cli') {
                try {
                    $this->addPlugin('Bake');
                } catch (MissingPluginException $e) {
                    // Do not halt if the plugin is missing
                }

                $this->addPlugin('Migrations');
            }

            /*
             * 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\Plugin::class);
            }

            // Other plugins
            $this->addPlugin('BootstrapUI');
            $this->addPlugin('Search');

阅读更多信息:

https://book.cakephp.org/3.0/en/console-and-shells/plugin-shell.html

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56318223

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档