src/Table.php
public function setAjax($ajax)
    {
        if (is_string($ajax)) {
            $pattern = '/^(\s+)*(function)(\s+)*\(/i';
            if (preg_match($pattern, $ajax, $matches) && strtolower($matches[2]) == 'function') {
                $hash = sha1($ajax);
                $this->properties['ajax'] = $hash;
                $this->callbacks[$hash] = $ajax;
                return $this;
            }

            $this->properties['ajax'] = $ajax;
            return $this;
        } else {
            $this->properties['ajax'] = $ajax;
            return $this;
        }
    }
public function setAjax($ajax)
    {
        if (is_string($ajax)) {
            $pattern = '/^(\s+)*(function)(\s+)*\(/i';
            if (preg_match($pattern, $ajax, $matches) && strtolower($matches[2]) == 'function') {
                $hash = sha1($ajax);
                $this->properties['ajax'] = $hash;
                $this->callbacks[$hash] = $ajax;
                return $this;
            }

            $this->properties['ajax'] = $ajax;
            return $this;
        } else {
            $this->properties['ajax'] = $ajax;
            return $this;
        }
    }
public function setAjax ( $ ajax ) { if ( is_string ( $ ajax ) ) { $ pattern = '/^(\s+)*(function)(\s+)*\(/i' ; if ( preg_match ( $ pattern , $ ajax , $ matches ) && strtolower ( $ matches [ 2 ] ) == 'function' ) { $ hash = sha1 ( $ ajax ) ; $ this -> properties [ 'ajax' ] = $ hash ; $ this -> callbacks [ $ hash ] = $ ajax ; return $ this ; } $ this -> properties [ 'ajax' ] = $ ajax ; return $ this ; } else { $ this -> properties [ 'ajax' ] = $ ajax ; return $ this ; } }
DataTables can obtain the data it is to display in the table table's body from a number of sources,
including from an Ajax data source, using this initialisation parameter. As with other dynamic data
sources, arrays or objects can be used for the data source for each row, with columns.dataDT
employed to read from specific object properties.

@param string|object|callback $ajax Load data for the table's content from an Ajax source.

@return Table
@see http://datatables.net/reference/option/ajax
DataTables can obtain the data it is to display in the table table s body from a number of sources including from an Ajax data source using this initialisation parameter . As with other dynamic data sources arrays or objects can be used for the data source for each row with columns . dataDT employed to read from specific object properties .