PHP code example of jungi / framework-extra-bundle
1. Go to this page and download the library: Download jungi/framework-extra-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/ */
jungi / framework-extra-bundle example snippets
namespace App\Controller;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\Routing\Attribute\Route;
use Jungi\FrameworkExtraBundle\Attribute\QueryParams;
use Jungi\FrameworkExtraBundle\Attribute\RequestBody;
use Jungi\FrameworkExtraBundle\Attribute\QueryParam;
use Jungi\FrameworkExtraBundle\Attribute\RequestParam;
use Jungi\FrameworkExtraBundle\Controller\ControllerTrait;
#[Route('/users')]
class UserController
{
use ControllerTrait;
#[Route('/{userId}/residential-address', methods: ['PATCH'])]
public function changeResidentialAddress(string $userId, #[RequestBody] UserResidentialAddressData $data)
{
// ..
}
#[Route('/{userId}/files/{fileName}', methods: ['PUT'])]
public function uploadFile(string $userId, string $fileName, #[RequestBody] UploadedFile $file)
{
// ..
}
#[Route('/{userId}/avatar', methods: ['PATCH'])]
public function replaceAvatar(string $userId, #[RequestParam] UploadedFile $file, #[RequestParam] string $title)
{
// ..
}
#[Route(methods: ['GET'])]
public function getUsers(#[QueryParam] ?int $limit = null, #[QueryParam] ?int $offset = null)
{
// ..
}
#[Route(methods: ['GET'])]
public function filterUsers(#[QueryParams] FilterUsersDto $filterData)
{
// ..
/** @var UserData[] $filteredUsers */
return $this->entity($filteredUsers);
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.