/** * Renders grid. * * @return View|string */ public function render() { $key = $this->getInputProcessor()->getUniqueRequestId(); $caching_time = $this->config->getCachingTime(); if ($caching_time && ($output = Cache::get($key))) { return $output; } else { $this->prepare(); $provider = $this->config->getDataProvider(); $provider->reset(); $output = View::make($this->getMainTemplate(), $this->getViewData())->render(); if ($caching_time) { Cache::put($key, $output, $caching_time); } return $output; } }
/** * @return View */ public function render() { $key = $this->getInputProcessor()->getUniqueRequestId(); $caching_time = $this->config->getCachingTime(); if ($caching_time and $output = Cache::get($key)) { return $output; } else { $this->prepare(); // if ($dp = Cache::get($key)) { // $this->config->setDataProvider($dp); // } else { // $dp = $this->config->getDataProvider(); // $dp->reset(); # performs query // Cache::put($key, $dp, 5); // } $provider = $this->config->getDataProvider(); $provider->reset(); $output = View::make($this->getMainTemplate(), $this->getViewData())->render(); if ($caching_time) { Cache::put($key, $output, $caching_time); } return $output; } }