lonnieezell / Bonfire2

CodeIgniter 4-based application skeleton

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Routes

Kr3m opened this issue · comments

My apologies in advance. I should've put this in discussion. Ugh.

I'm wondering what I can add to my routes so that the following code doesn't override the Bonfire routes:

$routes->get('(:any)', 'Servers::index/$1');

For now I've changed this to static code, but not sure if there is a workaround for this.

$routes->get('contact', 'Servers::index/contact');

commented

CodeIgniter Forums Archived Development & Programming - Excluding routes

Again, you must exclude any route that you do not want to be handled like categories:

$route['^(?!pages|assets).*'] = "/category/index/$0";

In this example, this $route entry will "disqualify" any URI route that begins with "pages" or "assets."

Also, please not that higher route entries take precedence over lower ones. From the manual:

Note: Routes will run in the order they are defined. Higher routes will always take precedence over lower ones.