Exemple #1
0
 /**
  * Creates an url with the base url and the given parameters
  *
  * @param string $controller
  * @param string $action
  * @param array  $data
  * @return string
  */
 public static function url($controller = '', $action = '', array $data = [])
 {
     $url = Settings::getBaseUrl();
     if ($controller) {
         $url .= $controller;
     }
     if ($action) {
         $url .= '/' . $action;
     }
     if (!empty($data)) {
         $url .= '?' . http_build_query($data);
     }
     return $url;
 }