Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Form::open action missing index file
  • Hi,

    When I do Form::open('path/to/controller') it does generate the following path: website.com/path/to/controller , atm. I don't use the mod_rewrite yet so my website controllers are accessible through the index.php, just like website.com/index.php/path/to/controller/. The problem is that the Form::open doesn't recognize such behaviour and its supposing to use the mod_rewrite path..

    Is it configurable by any chance?

    Regards,
    Lucas
  • Yes, it is, in your app/config/config.php:

        'index_file' => 'index.php',

  • Thanks. I have got another question:

    While I am under the index.php/controller/hello the var_dump(Uri::segments()) returns following:

    array(2) { [0]=> string(10) "controller" [1]=> string(5) "hello" }

    And thats okay, but when I am under the main controller page (index.php/controller/) the same var_dump returns NULL - it should return the

    array(1) { [0]=> string(10) "controller"}

    in my opinion, shouldnt it? There is no way to display the controller index segment.


  • I can not reproduce that.

    url: http://fuel.catwoman.exite.local/18develop/welcome/ gives:

    array (size=1)
      0 => string 'welcome' (length=7)


    same for http://fuel.catwoman.exite.local/18develop/index.php/welcome
  • Is the 'welcome' a controller in the 'app/classes/controller/welcome.php' and you have used the var_dump right in the action_index()?

    I am using a account.php controller, which has action_index.php function containing the var_dump, while viewing it, I can see the view etc. but var_dump(Uri::segments()) returns NULL;
  • HarroHarro
    Accepted Answer
    Yes.

    A different controller, in this case in a module called 'admin', works fine too:

    http://fuel.catwoman.exite.local/18develop/admin/test/index

    array (size=3)
      0 => string 'admin' (length=5)
      1 => string 'test' (length=4)
      2 => string 'index' (length=5)

    http://fuel.catwoman.exite.local/18develop/admin/test

    array (size=2)
      0 => string 'admin' (length=5)
      1 => string 'test' (length=4)

    To be complete, this works fine too: http://fuel.catwoman.exite.local/18develop/index.php/admin/test/index

Howdy, Stranger!

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

In this Discussion