1. Go to this page and download the library: Download roukmoute/hashids-bundle 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/ */
use Hashids\HashidsInterface;
public function postShow(HashidsInterface $hashids): Response
{
$hashids->…
}
use Roukmoute\HashidsBundle\Attribute\Hashid;
use Symfony\Component\Routing\Attribute\Route;
#[Route('/posts/{id}')]
public function show(#[Hashid] int $id): Response
{
// $id is automatically decoded from the hashid
}
#[Route('/posts/{hash}')]
public function show(#[Hashid(parameter: 'hash')] int $id): Response
{
// The 'hash' route parameter is decoded into $id
}
#[Route('/users/{hashid}')]
public function getAction(int $user): Response
{
}
#[Route('/users/{id}')]
public function getAction(int $user): Response
{
}
#[Route('/users/{_hash_user}/status/{_hash_status}')]
public function getAction(int $user, int $status): Response
{
}
// _hash_user _hash_status
// ↕ ↕
public function getAction(int $user, int $status)
#[Route('/users/{user}/status/{status}')]
public function getAction(int $user, int $status): Response
{
}
#[Route('/users/{hashid}')]
public function getAction(User $user): Response
{
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.