TP5.1 自定义标签,为什么会有缓存呢?

浏览:560 发布日期:2020/04/30 分类:求助交流 关键字: 标签缓存
使用TP5.1开发一个项目,里面使用到自定义标签,发现标签里面涉及到html的时候就会出现缓存,导致页面不能即时更新。这种现象是正常出现还是我操作错误?有没有解决的办法嘞,2333

我看到是大概因为temp文件的原因,这种怎么解决呢public function tagDic($tag)
    {

        $code = isset($tag['code'])?$tag['code']:'';
        $type = isset($tag['type'])?$tag['type']:'';
        $name = isset($tag['name'])?$tag['name']:'';
        $required = isset($tag['required'])?$tag['required']:'';
        $default = isset($tag['default'])?$tag['default']:'';

        if (empty($code))return '字典编码不能为空';
        if (empty($type))return 'HTML标签类型不能为空';

        $data = Dictionary::get(['code'=>$code]);

        switch ($type){
            case 'select':
                $select = '<select name="'.$name.'" lay-verify="'.$required.'">';
                $select .= '<option value=""></option>';
                foreach ($data->dictionaryItem as $k=>$v){
                    $select .= '<option value="'.$v['id'].'">'.$v['name'].'</option>';
                }
                $select .= '</select>';
                return $select;
                break;
            default:
                return '';
        }

    }
最佳答案
评论( 相关
后面还有条评论,点击查看>>