Functions name in ApiActionController are not same with Its Route

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
    {
    …
    }
…
  1. The old actions in Api_Action did not have names, they are only converted once (from old project) to ApiActionContoller for your own migration and maintenance. During conversion, PHPMaker will not parse your route paths to generate unique function names. You need to change the names to those meaningful to you yourself. In fact, you should also update the parameters.
  2. Function names do not need to be same as route paths.
  3. Also read migration guide:

After conversion, you can maintain your code in the Code -> Custom Templates -> Table-Specific -> Custom File -> Content section of the custom files. With the new format you can modify your route attributes (including security), route parameters (and method arguments), and the route actions easily.

For smooth upgrade, PHPMaker will try to make minimal changes to your code, keeping the parameters unchanged. However, to make your code performs better for the long run, you should update your controller action's arguments and the response object as explained below.

All right, then.