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

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

- Page: https://pluginprobe.com/plugins/bit-form/1.1.8/code/includes/Core/Ajax/AjaxService.php
- Raw: https://pluginprobe.com/plugins/bit-form/1.1.8/raw/includes/Core/Ajax/AjaxService.php
- Modified: 2020-09-05T12:07:00+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/1.1.8/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\Frontend\Ajax\FrontendAjax;
use BitCode\BitForm\Core\Integration\Integrations;

class AjaxService
{
    public function __construct()
    {
        if (Request::Check('ajax')) {
            $this->loadPublicAjax();
        }
        if (Request::Check('admin')) {
            $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();
        
    }
}

```
