PHP code example of g3n1us / datatidy

1. Go to this page and download the library: Download g3n1us/datatidy library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

g3n1us / datatidy example snippets


$defaultoptions = [
	'allow_origin' => null, // If a response is to be generated, this value will be applied to an Access-Control-Allow-Origin header
	'resultsas' => 'collection', // or paginate or array
	'sort' => false, // key by which to sort
	'ascending' => false, // applies to the sort order
	'nomd' => false, // my default, content will be converted to HTML with Markdown, this option disables this
	'paginate' => false,
	'show_pagination' => true,
	'results_per_page' => 12,
];

DataTidy::response("gproxy://1R4ZW6fw7EggY6AsmBtVGWdjny-UYDgv3au6_VarHBMk", ['allow_origin' => '*']);
// Returns a full Response

DataTidy::get("gproxy://1R4ZW6fw7EggY6AsmBtVGWdjny-UYDgv3au6_VarHBMk");
// Returns the data as an instance of Illuminate\Collection

use G3n1us\DataTidy;

$datatidy = new Datatidy("gproxy://1R4ZW6fw7EggY6AsmBtVGWdjny-UYDgv3au6_VarHBMk");
$datatidy->get();
// or
$datatidy->response();