Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
change uri before routing
  • remove first segment of uri before route start
    show address in browser : en/test/asd
    process address : test/asd
    this is what i do:
    create Start class extends Fuel\Core\Uri
    call class in app/bootstrap.php
    in Start Class i change $this->segments and $this->uri
    but noting change and it work in fuel 1.7



  • Harro VertonHarro Verton
    Accepted Answer
    Always a risk when you start changing internal classes, if the URI class changes it's logic, or the processing logic changes, you have problems like this.

    If you look at the processing logic, the application bootstrap is called from index.php, before the request is forged, so at that time you don't have a valid URI object yet.

    If you want to do it this way, it's better to manipulate the $_SERVER entry itself, extract the first URL segment, check if it is a valid language, and if s, update the $_SERVER entry with a new URL.

    Alternatively, you can try to bring the URI parsing forward, using

    $uri = new \Uri($this->input->uri());

    Which forces input to start parsing the URL in $_SERVER.
  • hi Harro,
    Thank you as Always;

Howdy, Stranger!

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

In this Discussion