基于App目录下的插件或模块如何创建自己的函数库呢
1、新建文件:dayrui/App/Test/Helpers/My.php (文件名首字母大写)
2、新写方法体:
<?php function my_test_hello() { return 'xunruicms'; }
加载函数文件,相当于是require操作:
\Phpcmf\Service::H('文件名称', 'app目录名称');
那么,加载后才能使用自定义函数:
\Phpcmf\Service::H('my', 'test'); echo my_test_hello();
文档最后更新时间:2021-10-20 07:03:32