プラグインの作成
ステップ1:プラグインディレクトリの作成
public/plugin/MyPlugin/ステップ2:プラグインクラスの定義
<?php
class MyPluginPlugin extends Plugin
{
protected function __construct()
{
$settings = [
'tool_enable' => 'boolean',
'api_key' => 'text',
];
parent::__construct('1.0', 'Your Name', $settings);
}
public static function create(): static
{
static $instance = null;
return $instance ??= new static();
}
}利用可能な設定タイプ
タイプ
説明
ステップ3:plugin.phpファイルの作成
ステップ4:インストールおよびアンインストールスクリプトの作成
ステップ5:翻訳の追加
ステップ6:表示領域を介したコンテンツの注入
ステップ7:プラットフォームイベントへの反応(オプション)
ステップ8:ライフサイクルフック
メソッド
トリガーされるタイミング
ステップ9:有効化
ヒント
最終更新
役に立ちましたか?