1. Go to this page and download the library: Download aol/transformers 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/ */
public function define($app_name, $ext_name, callable $app_func = null, callable $ext_func, $app_args = [], $ext_args = []);
class Post extends \Aol\Transformers\Transformer
{
public function __construct()
{
$this->define('id', 'Id', 'intval', 'strval');
$this->define('title', 'Title');
$this->define('tags', 'post_tags', 'json_decode', 'json_encode');
}
}
class Post extends \Aol\Transformers\Transformer
{
use \Aol\Transformers\Utilities\MysqlTrait,
\Aol\Transformers\Utilities\UtilityTrait;
public function __construct()
{
$this->defineId('id', 'Id');
$this->define('title', 'Title');
$this->defineJson('tags', 'post_tags');
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.