2018-09-26thinkphp 5获取所有控制器的名称和方法方法 /** *获取某个目录下的php文件名的函数 */ function getControllers($dir) { $pathList = glob($dir . '/*.php'); $res = []; foreach($pathList as $key => $value) { $res[] = basename($value, '.php');
2018-09-06tp5设置永久配置项/** * 修改扩展配置文件 * @param array $arr 需要更新或添加的配置 * @param string $file 配置文件名(不需要后辍) * @return bool */ function extraconfig($arr = [], $file = 'extraconfig') { if (is_array($arr)) { $f
2018-07-30tp5 上使用ueditor富文本插件将官方下载的数据包放入static 在需要的地方引入 {js href="__STATIC__/ueditor/ueditor.config.js" /} {js href="__STATIC__/ueditor/ueditor.all.js" /} var ue = UE.getEditor('container',{ // initialFrameWid#ueditor
2018-07-24Thinkphp5 | 读取文件中的配置信息extra//方法位置/thinkphp/library/think/Config/---get方法 // 配置文件位置application/extra/文件名.php //文件内容格式 return [ ] //使用 use think\Config; $menu = Config::get('文件名');#thinkphp5
2018-07-04转载 | ThinkPHP5自动生成缩略图函数function thumb($src = '', $width = 500, $height = 500, $type = 1, $replace = false) { $src = './'.$src; if(is_file($src) && file_exists($src)) { $ext = pathinfo($src, PATHINFO_EXTE
2018-07-04转载 | ThinkPHP5+Layui实现图片上传加预览 图片 上传图片 layui.use('upload',function(){ var upload = layui.upload, jq = layui.jquery; upload.render({ url: '{:url("index/upload")}' ,elem:'#image' ,ext: 'jpg|png|gif' ,area: ['500#图片上传#layui#thinkphp
2018-07-01转载 | 关于TP5模板输出时间戳问题--A non well formed numeric value encountered某日。因为一个项目。控制器我是这么写的 /** * get admin/Picture/index * 显示所有图册信息 * @return view */ public function index() { $data = $this->model->getAllPicture(); // dump($data); $this->assign('data'