Getting "anonymous" parameters without routing

Hey all,

I have a url in my app which goes

What's the best way of getting the "abcdefg" and "123456" parameters ? Without explode()'ing the URL, clearly

Thanks Shai


Aren't you using Phalcon\Mvc\Router?

I'm using the default behavior. If I understood correctly there's a default behavior with which I wouldn't have to define routes using a custom Router.

The docs aren't really specific about that and the information about Router shows how to use the class but not where to actually use it.. which makes it a bit tricky. I would rather not use it for this specific situation but if its an easier option, I can ...

edited Oct '14

OK, I misunderstood because the title says "Getting "anonymous" parameters without routing", I assume default routes is also routing, but nevermind

You just have to receive those parameters in the action:

public function addAction($param1, $param2)
    $param1; // abcdefg
    $param2; // 123456

Hah. easy and smooth. Would be cool to find this in the docs ... I couldn't find it when looking in the Routing docs.

Thank you very much :) Shai

edited Oct '14


//or use getParams() to get all parameters in array