Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Api version in route config file
  • I'm building an API based in version

    that my route config file.
    ':version/content/category'                            =>            'graph/v1/content/category/list/$1',

    is there a way to locate folder associated to the Version entered in url?
    example : if user enter http://myhost.com/v2/content/category i'll use the file located in folder v2
    'graph/v2/content/caegory'.
    Thanks for your help

  • HarroHarro
    Accepted Answer
    I'm trying to understand what you want. You want to route "/v2/content/category" to controller "./app/classes/graph/v2/content/category"?

    If so, your $1 is in the wrong place, if you want to map the version, you should use:

    ':version/content/category' => 'graph/$1/content/category',

  • Thanks my problem is solved

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion