I'm looking for a way to get the base Uri of my project. Especially for form creation (action=htt://url.com/controller/method).
I tried :
Uri::base()
But it provides me with http://url.com/public/, that's not supposed to be base .
I don't get the logic because in docs it says it should give me http://url.com/index.php or http://url.com/ depending of the boolean I pass to the method ^^'. Someone could explain me ?
The base url is composed of what you define in your config.php for "base_url" (which should point to the root of your website) and "index", which determines if index.php is or isn't a part of the url.
How you configure this greatly depends on what exactly your docroot is (whould be /public as described in the docs, but probably isn't), and whether or not you use rewriting to get rid of the index.php.
So let us know what your setup is, and we might be able to give an answer.
Oh I get it now.
I didn't see that I was supposed to use public as Document Root for my Web server. It sounds way more logical now and it's a great security feature. Now that I use public as my root folder everything go well.
Also I was ever using the .htaccess + config file to get rid of index.php
I'm coming from CodeIgniter and never seen something like this but it's perfectly better !
The idea of using public as your document root is that now all your code and other files are no longer accessable by the browser. In case of a hack, it makes it a lot more difficult to exploit.