1. Go to this page and download the library: Download chenqd/yii2-presenter 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/ */
chenqd / yii2-presenter example snippets
use chenqd\presenter\PresentableTrait;
class User {
use PresentableTrait;
public function presenterMap()
{
return [
'default' => UserPresenter::class,
'api' => UserPresenter::class,
];
}
public $first = 'php';
public $last = 'world';
}