Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Router Phalcon

Hi everyone,

I have a question I could not find anywhere, and I ask your help.

Well, I need the first parameter of the URI is "ignored" and save it in a session, as this first parameter is the user's system.

Examples

www.system.com/enterprise1/xxxxx

www.system.com/enterprise2/xxxxx

www.system.com/enterprise3/xxxxx

Thanks !



31.3k
Accepted
answer

Hi,

I've not tested it, but this is how would code it:

$router->add(
    "/([a-zA-Z0-9_-]+)/:controller/:action/:params",
    array(
        "controller" =>2,
        "action"     => 3,
        "params"     => 4,
    )
);

Thanks man !

It was exactly what I wanted.