예제 #1
0
파일: Json.php 프로젝트: edrdesigner/awf
 /**
  * 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;
 }
예제 #2
0
 /**
  * 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);
     }
 }