url_to not working? |
It seems like the built in url_to function isn't working.
Code: <a class="navbar-brand" href="<?= url_to('Home::index'); ?>">My Site</a> Home controller: PHP Code: <?php Routing: PHP Code: $routes->get('/', 'Home::index'); Error message:
I have a similar problem. Inside "Controllers" folder I have "Admin" folder. And I can't get path to a controller inside it, it throws the same error.
Code: <a href="<?= url_to('App\Controllers\Admin\Categories::index') ?>">
@IvanBell, do you have the folders and file capitalized like in your path?
Code: app Did you name the class correctly in your file? PHP Code: <?php
Thank you, the problem was with the routes. It was not obvious for me from the docs that url_to() only works if I have the route inside Config/Routes. Lack of experience, I guess
|
Welcome Guest, Not a member yet? Register Sign In |