CakePHP
  • 文档
    • 手册
    • API
    • 视频
    • 报告安全问题
    • 隐私政策
    • 标识和商标
  • 商业解决方案
  • 周边产品
  • 公路旅行
  • 团队
  • 社区
    • 社区
    • 参与进来
    • 问题 (Github)
    • 面包店
    • 精选资源
    • 培训
    • 聚会
    • 我的 CakePHP
    • CakeFest
    • 新闻稿
    • LinkedIn
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • 帮助与支持
    • 论坛
    • Stack Overflow
    • IRC
    • Slack
    • 付费支持
CakePHP

C CakePHP 5.1 Chiffon API

  • 项目
    • CakePHP
      • CakePHP
      • Chronos
      • Elastic Search
      • 队列
  • 版本
    • 5.1
      • 5.1
      • 5.0
      • 4.5
      • 4.4
      • 4.3
      • 4.2
      • 4.1
      • 4.0
      • 3.10
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

命名空间

  • 全局
  • Cake
    • Cache
    • Collection
    • Command
    • Console
    • Controller
    • Core
      • Configure
      • Exception
      • Retry
      • TestSuite
    • Database
    • Datasource
    • Error
    • Event
    • Form
    • Http
    • I18n
    • Log
    • Mailer
    • Network
    • ORM
    • Routing
    • TestSuite
    • Utility
    • Validation
    • View

接口 PluginInterface

插件接口

命名空间: Cake\Core

常量

  • list<string>
    VALID_HOOKS ¶
    ['bootstrap', 'console', 'middleware', 'routes', 'services', 'events']

    有效钩子列表。

方法摘要

  • bootstrap() public

    加载所有应用程序配置和引导逻辑。

  • console() public

    为插件添加控制台命令。

  • disable() public

    禁用指定的钩子

  • enable() public

    启用指定的钩子

  • getClassPath() public

    获取此插件的配置的文件系统路径

  • getConfigPath() public

    获取此插件的配置的文件系统路径

  • getName() public

    获取此插件的名称。

  • getPath() public

    获取此插件的文件系统路径

  • getTemplatePath() public

    获取此插件的模板的文件系统路径

  • isEnabled() public

    检查指定的钩子是否启用

  • middleware() public

    为插件添加中间件。

  • routes() public

    为插件添加路由。

  • services() public

    向应用程序的容器注册插件服务

方法详情

bootstrap() ¶ public

bootstrap(Cake\Core\PluginApplicationInterface $app): void

加载所有应用程序配置和引导逻辑。

此方法的默认实现将包含插件中的config/bootstrap.php(如果存在)。您可以覆盖此方法以替换该行为。

主机应用程序作为参数提供。这允许您加载额外的插件依赖项或附加事件。

参数
Cake\Core\PluginApplicationInterface $app

主机应用程序

返回值
void

console() ¶ public

console(Cake\Console\CommandCollection $commands): Cake\Console\CommandCollection

为插件添加控制台命令。

参数
Cake\Console\CommandCollection $commands

要更新的命令集合

返回值
Cake\Console\CommandCollection

disable() ¶ public

disable(string $hook): $this

禁用指定的钩子

参数
string $hook

要禁用的钩子

返回值
$this

enable() ¶ public

enable(string $hook): $this

启用指定的钩子

参数
string $hook

要禁用的钩子

返回值
$this

getClassPath() ¶ public

getClassPath(): string

获取此插件的配置的文件系统路径

返回值
string

getConfigPath() ¶ public

getConfigPath(): string

获取此插件的配置的文件系统路径

返回值
string

getName() ¶ public

getName(): string

获取此插件的名称。

返回值
string

getPath() ¶ public

getPath(): string

获取此插件的文件系统路径

返回值
string

getTemplatePath() ¶ public

getTemplatePath(): string

获取此插件的模板的文件系统路径

返回值
string

isEnabled() ¶ public

isEnabled(string $hook): bool

检查指定的钩子是否启用

参数
string $hook

要检查的钩子

返回值
bool

middleware() ¶ public

middleware(Cake\Http\MiddlewareQueue $middlewareQueue): Cake\Http\MiddlewareQueue

为插件添加中间件。

参数
Cake\Http\MiddlewareQueue $middlewareQueue

要更新的中间件队列。

返回值
Cake\Http\MiddlewareQueue

routes() ¶ public

routes(Cake\Routing\RouteBuilder $routes): void

为插件添加路由。

此方法的默认实现将包含插件中的config/routes.php(如果存在)。您可以覆盖此方法以替换该行为。

参数
Cake\Routing\RouteBuilder $routes

要更新的路由构建器。

返回值
void

services() ¶ public

services(Cake\Core\ContainerInterface $container): void

向应用程序的容器注册插件服务

参数
Cake\Core\ContainerInterface $container

容器实例。

返回值
void
OpenHub
Pingping
Linode
  • 商业解决方案
  • 展示
  • 文档
  • 手册
  • API
  • 视频
  • 报告安全问题
  • 隐私政策
  • 标识和商标
  • 社区
  • 参与进来
  • 问题 (Github)
  • 面包店
  • 精选资源
  • 培训
  • 聚会
  • 我的 CakePHP
  • CakeFest
  • 新闻稿
  • LinkedIn
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • 帮助与支持
  • 论坛
  • Stack Overflow
  • IRC
  • Slack
  • 付费支持

使用 CakePHP API 文档 生成