I've just started out with Phalcon, the first PHP framework I've ever used. I'm currently developing on a site which will be in both English and Swedish. The English site will feature four different pages being: Home, About, Contact and Extras. The Swedish site will be exactly the same but with: Hem, Om, Kontakt and Extra instead. I want the url to look like this:
What would be the best way to achive this? I've looked into routing and tested this piece of code:
$router->add( "/sv/om/:action", array( "language" => "sv", "controller" => "about", "action" => 2, ) );
Even though this would work just fine, you would have to add every single controller, I would instead prefer to have some sort of configuration file like the following array:
$sites = array( "hem" => "home", "om" => "about", "kontakt" => "contact", "extra" => "extras" );
To handle this instead. I've also looked into using convert for the route but I don't know how to implement that.
Much help is appreciated! Also great work with this awesome framework, I'm looking forward to dig deeper in to this.