Home > database >  The url gets corrupted when I go to post detail
The url gets corrupted when I go to post detail

Time:12-26

When I go to detail, I overwrite the menu links and get an error.

route

 $routes->group('(en|tr)', ['namespace' => 'App\Controllers\Frontend'], function ($routes) {
    $routes->get('announcement-detail/(:any)', 'Home::announcementDetail/$1/$2');

detail link

<a href="announcement-detail/<?= $key['yazi_id']; ?>"
                                           >

url error

enter image description here

CodePudding user response:

you need to configure your url like this

 <a href="<?= base_url('announcement-detail') ?>/<?= $key['yazi_id']; ?>">
  • Related