Example #1
0
 //get request
 $elements = explode("/", Util::PageUri());
 $element0 = '';
 $element1 = '';
 $element2 = '';
 if (count($elements) >= 1) {
     $element0 = $elements[0];
 }
 if (count($elements) >= 2) {
     $element1 = $elements[1];
 }
 if (count($elements) >= 3) {
     $element2 = $elements[2];
 }
 //always get user
 $user = Application::GetUser();
 //fork if api
 if ($element0 == 'api') {
     $langCode = Params::Get('lang', 'en');
     $dictionary = new Dictionary($langCode, 'treatnow.');
     if ($element1 == 'providers') {
         $response = new ProvidersResponse();
     } elseif ($element1 == 'subscribe') {
         $response = new SubscriptionResponse($user, $dictionary);
     } elseif ($element1 == 'subscribe-name') {
         $response = new SubscriptionNameResponse($user, $dictionary);
     } elseif ($element1 == 'categories') {
         $response = new CategoriesResponse($dictionary);
     } elseif ($element1 == 'contact') {
         $response = new ContactResponse($user, $dictionary);
     } elseif ($element1 == 'verify-provider') {