# bit-form/2.15.3/includes/Core/Ajax/AjaxService.php

Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator &amp; Custom Form Builder, version 2.15.3. 53 lines.

- Page: https://pluginprobe.com/plugins/bit-form/2.15.3/code/includes/Core/Ajax/AjaxService.php
- Raw: https://pluginprobe.com/plugins/bit-form/2.15.3/raw/includes/Core/Ajax/AjaxService.php
- Modified: 2024-02-15T12:11:02+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/bit-form/2.15.3/code/includes/Core/Ajax/AjaxService.php#L10-L20`.

```php
<?php

namespace BitCode\BitForm\Core\Ajax;

use BitCode\BitForm\Admin\AdminAjax;
use BitCode\BitForm\Core\Capability\Request;
use BitCode\BitForm\Core\Integration\Integrations;
use BitCode\BitForm\Frontend\Ajax\FrontendAjax;

class AjaxService
{
  public function __construct()
  {
    if (Request::Check('ajax')) {
      $this->loadPublicAjax();
    }
    if (Request::Check('admin') && (current_user_can('manage_bitform') || current_user_can('manage_options'))) {
      $this->loadAdminAjax();
      $this->loadIntegrationsAjax();
    }
  }

  /**
   * Helps to register admin side ajax
   *
   * @return null
   */
  public function loadAdminAjax()
  {
    (new AdminAjax())->register();
  }

  /**
   * Helps to register frontend ajax
   *
   * @return null
   */
  protected function loadPublicAjax()
  {
    (new FrontendAjax())->register();
  }

  /**
   * Helps to register integration ajax
   *
   * @return null
   */
  public function loadIntegrationsAjax()
  {
    (new Integrations())->registerAjax();
  }
}

```
