1. Go to this page and download the library: Download lewis/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/ */
namespace App\Presenters;
use Lewis\Presenter\AbstractPresenter;
class UserPresenter extends AbstractPresenter
{
}
namespace App\Presenters;
use App\SomeNamespace\SomeClass;
use Lewis\Presenter\AbstractPresenter;
class UserPresenter extends AbstractPresenter
{
protected $class;
public function __construct($object, SomeClass $class)
{
$this->class = $class;
parent::__construct($object);
}
}
public function prettySlug()
{
return '/'.ltrim($this->slug, '/');
}
public function prettySlug()
{
return '/'.ltrim($this->object->slug, '/');
}