/** * Returns a JUri instance with a prototype URI used as the base for the * other URIs created by the JSON renderer * * @return Uri The prototype JUri instance */ protected function _getPrototypeURIForPagination() { $protoUri = new Uri(Uri::rebase('index.php', $this->container)); $protoUri->setQuery($this->input->getData()); $protoUri->delVar('savestate'); $protoUri->delVar('base_path'); return $protoUri; }
/** * Sets the additional URL parameters from the input. If no input is specified we will use the application's * input. The URL parameters of the base URL will be automatically removed. * * @param Input $input The input object to use * * @return void */ public function setAdditionalUrlParamsFromInput(Input $input = null) { // Make sure we have an input if (!is_object($input)) { $input = $this->application->getContainer()->input; } // Get the input's data array $data = $input->getData(); // Get the rebase URL parameters to eliminate $rebase = Uri::rebase('index.php', $this->application->getContainer()); $rebase = new Uri($rebase); $eliminateParams = $rebase->getQuery(true); $eliminateParams = array_keys($eliminateParams); // Set the additional URL parameters foreach ($data as $key => $value) { // We can't process object data automatically if (is_object($value)) { continue; } // We can't process array data automatically if (is_array($value)) { continue; } // Ignore the URL parameters from the URL rebasing if (in_array($key, $eliminateParams)) { continue; } $this->setAdditionalUrlParam($key, $value); } }