1

I have BlogController that has multi actions in it. I want to be able to change my route path to another from my database. Suppose I want to change the word blog to news in my database.

namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;

class BlogController extends AbstractController
{
    /**
     * @Route("/blog", name="blog_list") BEFORE CHANGE
     * @Route("/news", name="blog_list") AFTER CHANGE
     */
    public function list()
    {
        // ...
    }
}

it is possible?

  • 1
    Read [How to Create a custom Route Loader](https://symfony.com/doc/current/routing/custom_route_loader.html) – gp_sflover Oct 23 '19 at 12:27

0 Answers0