企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# 13-1 插件函数库 ## 插件函数库 插件函数库用于插件内部使用,在插件根目录创建`common.php`文件即可。 ![](https://img.kancloud.cn/74/25/74256d0fe5955f74518cfa8eb79b92d7_321x249.png) demo函数示例,之后在插件控制器等插件内部即可调用demo函数。 ``` <pre class="calibre20">``` <span class="token"><</span><span class="token">?</span>php <span class="token2">if</span> <span class="token1">(</span><span class="token">!</span><span class="token6">function_exists</span><span class="token1">(</span><span class="token4">'demo'</span><span class="token1">)</span><span class="token1">)</span> <span class="token1">{</span> <span class="token2">function</span> <span class="token6">demo</span><span class="token1">(</span><span class="token1">)</span> <span class="token1">{</span> echo <span class="token3">1</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span> ``` ```