for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace AbterPhp\Admin\Http\Controllers\Admin;
use AbterPhp\Framework\Constant\Session;
use Opulence\Routing\Urls\URLException;
use Opulence\Routing\Urls\UrlGenerator; // @phan-suppress-current-line
use Opulence\Sessions\ISession; // @phan-suppress-current-line
trait UrlTrait
{
/**
* @return string
* @throws URLException
*/
protected function getShowUrl(): string
/** @var ISession $session */
$session = $this->session;
if ($session->has(Session::LAST_GRID_URL)) {
return (string)$session->get(Session::LAST_GRID_URL);
}
/** @var UrlGenerator $urlGenerator */
$urlGenerator = $this->urlGenerator;
$url = $urlGenerator->createFromName(strtolower(static::ENTITY_PLURAL));
AbterPhp\Admin\Http\Cont...UrlTrait::ENTITY_PLURAL
return $url;
* @param string $id
*
protected function getEditUrl(string $id): string
$url = $urlGenerator->createFromName(sprintf(static::URL_EDIT, strtolower(static::ENTITY_PLURAL)), $id);
AbterPhp\Admin\Http\Cont...dmin\UrlTrait::URL_EDIT