• Tp5.1 管理后台开发纪要


    1. tp5.1 对网页是有缓存机制的

    E:phpStudyPHPTutorialWWWNewAdmin hinkphplibrary hinkTemplate.php

    下display方法 如果缓存内有所请求的页面则 使用,这也是为什么自己添加上了很多东西, 所请求页面没有变化的原因

    在tp根目录运行清除缓存命令问题解决

    php think clear   
     /**
         * 渲染模板内容
         * @access public
         * @param  string    $content 模板内容
         * @param  array     $vars 模板变量
         * @param  array     $config 模板参数
         * @return void
         */
        public function display($content, $vars = [], $config = [])
        {
            if ($vars) {
                $this->data = $vars;
            }
    
            if ($config) {
                $this->config($config);
            }
    
            $cacheFile = $this->config['cache_path'] . $this->config['cache_prefix'] . md5($content) . '.' . ltrim($this->config['cache_suffix'], '.');
    
            if (!$this->checkCache($cacheFile)) {  //此处是说检查一下缓存内有无上次请求的页面如果没有,则重新生成. 否则就用以前的.
                // 缓存无效 模板编译
                $this->compiler($content, $cacheFile);
            }
  • 相关阅读:
    console.log眼见不一定为实
    播放器
    js变量
    js函数
    js数组
    设置默认浏览器
    this.$nextTick()用法
    进程理论+创建进程的两种方法+进程join方法+进程间数据相互隔离
    风险可视化项目记录1
    HTML笔记
  • 原文地址:https://www.cnblogs.com/zuochanzi/p/11425299.html
Copyright © 2020-2023  润新知