Пример #1
0
 /**
  *This method returns the controller from this url
  *
  *@param null
  *@return string The controller name
  */
 public function getController()
 {
     //break url string into array of substrings
     $array = explode("/", $this->url);
     //procede if parameters were found
     if (sizeof($array) > 0) {
         //remove empty elements
         $array = ArrayUtility::clean($array);
         //remove whitespace from array elements
         $array = ArrayUtility::trim($array);
         //check if array still contains elements
         if (sizeof($array) > 0) {
             //set the parameters array value
             $this->parameters = $array;
             //return the controller
             return $array[0];
         } else {
             //return null
             return null;
         }
     } else {
         //return null for controller
         return null;
     }
 }