Codeigniter缓存单个

时间:2015-05-25 08:26:59

标签: php codeigniter caching

我有以下功能:

   class Pharmacy extends MY_Controller {

        function __construct() {
            parent::__construct();
        }

        function index() {

            $data['pack'] = $this->package();
            $data['name'] = $this->getName();
            $data['title'] = $this->title();
            $data['name'] = $this->getName();
            $data['tests'] = $this->get_tests();
            $data['patient_bio'] = $this->patient_bio();
            $data['procedure_name'] = $this->getProcedure();

           //Pass the contents of pharmacy view to the  template view. 
            $data1['contents'] = 'pharmacy';
            $finaldata = array_merge($data, $data1);
            $this->base_params($finaldata);
        }

        function base_params($data) {
          //Load the  base template for the function.
            $this->output->cache(3000);
            $data['title'] = 'Pharmacy';
            $this->load->view('template', $data);
        }
    }

我想缓存下面的视图模板但是当我通过$ this-> output-> cache(3000)时;它缓存整个网页,而不是仅缓存模板视图。如何只缓存模板视图?

0 个答案:

没有答案