Blogger Information
Blog 19
fans 0
comment 1
visits 43853
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
yii 项目里定义全局函数
好想睡懒觉的博客
Original
718 people have browsed it

像tp5 那样定义一些助手函数使用,可能用以下步骤来实现 

1、在yii根目录新建一个公共目录,名字看你取,我的叫common

2、在common目录下新建文件function,php

微信图片_20200713185138.png

3、在入口文件里引用即可使用,入口文件路径:web\index.php

微信图片_20200713185333.png


4、使用方法:在控制器里可以直接dump($arr); ok!







Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post