![]() |
myth: links in views are displayed wrong - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: myth: links in views are displayed wrong (/showthread.php?tid=75739) |
myth: links in views are displayed wrong - muuucho - 03-11-2020 I am trying to get familiar with myth/auth. I have installed it and when I visit the login page, the links in that view are missing my project's name in the url: Register goes to 'localhost/register' instead of 'localhost/my-project/register'. I guess the problem is my setup. In app.php I have set Code: public $baseURL = 'http://localhost/my-project/'; Code: $pathsPath = FCPATH . 'app/Config/Paths.php'; RE: myth: links in views are displayed wrong - muuucho - 03-12-2020 Update: I run the project above on my Apache server. If I instead run it on PHP's built in server from the root of my project (c:xampp/localhost/htdocs/my-project) I get rid of the subfolder problem and route_to() is working without being rapped in base_url(). Still, shouldn't route_to() use baseURL from config? RE: myth: links in views are displayed wrong - InsiteFX - 03-12-2020 The route_to uses a named route. See my route for dashboard below, ['as' => 'dashboard'] PHP Code: $routes->get('dashboard', 'Admin::dashboard', ['as' => 'dashboard']); So my route_to would be in html like below. PHP Code: <?= route_to('dashboard') ?> RE: myth: links in views are displayed wrong - muuucho - 03-12-2020 OK, then is Myth missing the routes? RE: myth: links in views are displayed wrong - kilishan - 03-12-2020 What version of CodeIgniter are you using? RE: myth: links in views are displayed wrong - muuucho - 03-13-2020 (03-12-2020, 01:41 PM)kilishan Wrote: What version of CodeIgniter are you using?I'm using 4.0.2 RE: myth: links in views are displayed wrong - muuucho - 03-14-2020 (03-12-2020, 05:07 AM)InsiteFX Wrote: The route_to uses a named route.Yes, Lonnie has routes like: Code: $routes->get('register', 'AuthController::register', ['as' => 'register']); |