PHPMaker 2026.9.0.
When the older project that created with v2025 has the code in Api_Action server event, then opened with v2026, then the function name under its Route is not same with its Route name, as follows:
<?php
namespace {ProjectNamespace};
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\Routing\Requirement\Requirement;
// #[IsGranted('IS_AUTHENTICATED')] // Note: Uncomment if security is required
class ApiActionController
{
#[Route('/api/getcba/{token}/{id}', methods: ['GET'])]
public function action1(ServerRequestInterface $request, ResponseInterface $response, RouteArgs $args, string $token, string $id): ResponseInterface
{
…
}
#[Route('/api/getKodeProyekperKantor/{nopen}', methods: ['GET'])]
public function action2(ServerRequestInterface $request, ResponseInterface $response, RouteArgs $args, string $nopen): ResponseInterface
{
…
}
#[Route('/api/GetPersentasePpn/{kode_proyek}', methods: ['GET'])]
public function action3(ServerRequestInterface $request, ResponseInterface $response, RouteArgs $args, string $kode_proyek): ResponseInterface
{
…
}
…
As you can see from the code above, the function name action1, action2, and action3 are not same with its Route, which are: getcba, getKodeProyekperKantor, and GetPersentasePpn.
Can you change the logic when converted Api_Action to ApiActionController those function name are automatically same with its Route?
So that code above should be like this:
<?php
namespace {ProjectNamespace};
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\Routing\Requirement\Requirement;
// #[IsGranted('IS_AUTHENTICATED')] // Note: Uncomment if security is required
class ApiActionController
{
#[Route('/api/getcba/{token}/{id}', methods: ['GET'])]
public function getcba(ServerRequestInterface $request, ResponseInterface $response, RouteArgs $args, string $token, string $id): ResponseInterface
{
…
}
#[Route('/api/getKodeProyekperKantor/{nopen}', methods: ['GET'])]
public function getKodeProyekperKantor(ServerRequestInterface $request, ResponseInterface $response, RouteArgs $args, string $nopen): ResponseInterface
{
…
}
#[Route('/api/GetPersentasePpn/{kode_proyek}', methods: ['GET'])]
public function GetPersentasePpn(ServerRequestInterface $request, ResponseInterface $response, RouteArgs $args, string $kode_proyek): ResponseInterface
{
…
}
…