<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ## 鉤子 每個插件都必須至少對應一個鉤子,添加鉤子,需要先在控制器中添加以下方法 ~~~ $re = hook('sendsms', ['params' => [ 'mobile' => $mobile ]]); ~~~ 或在視圖中添加 ~~~ {:hook('addgoodsview')} ~~~ 然后在后臺->控制面板->鉤子列表中添加對應的鉤子即可。 ![](https://box.kancloud.cn/0f170b56f838f23b432af15cc8ee20ef_385x404.png) ## 插件 每個插件都有一個入口文件,命名方式為`插件名稱.php`,這里以`Helloworld`為例。 在`addons`目錄下建立一個新插件目錄`helloworld`,再新建一個`Helloworld.php`的入口文件。 ~~~ addons ├─helloworld │ │ Helloworld.php ~~~ 插件有一個獨立的頂級命名空間”`addons`“,所有插件入口文件必須繼承`use myxland\addons\Addons;`,并且必須實現三個方法:`install()`和`uninstall()`和`config()`。 比如: ``` <?php namespace addons\helloworld; use myxland\addons\Addons; /** * 演示插件 */ class Helloworld extends Addons { /** * 安裝方法必須實現 */ public function install(){ return true; } /** * 卸載方法必須實現 */ public function uninstall(){ return true; } /** *必須實現配置函數 */ public function config(){ } } ``` 然后還需要定義插件的相關信息`$info`參數。 ``` <?php namespace addons\helloworld; use myxland\addons\Addons; /** * 演示插件 */ class Helloworld extends Addons { /** * @var array 插件信息 */ public $info = [ // 插件名[必填] 'name' => 'helloworld', // 插件標題[必填] 'title' => '你好,世界', // 插件唯一標識[必填],格式:插件名.開發者標識.plugin 'description' => 'helloworld.ming.plugin', // 插件作者[必填] 'author' => 'mark', // 插件版本[必填],格式采用兩段式:主版本號.次版本號 'version' => '1.0.0' ]; /** * 安裝方法必須實現 */ public function install(){ return true; } /** * 卸載方法必須實現 */ public function uninstall(){ return true; } /** *必須實現配置函數 */ public function config(){ } //插件要實現對應鉤子的方法 public function sendsms(){ } } ``` 定義好之后,就可以進入后臺->控制面板->插件管理,進行安裝了。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看