// 方法一:
use App\Controllers\Pages;
$routes->get('pages', [Pages::class, 'index']);
$routes->get('(:segment)', [Pages::class, 'view']);
// 方法二:
$routes->get('pages', 'Pages::index');
$routes->get('(:segment)', 'Pages::view/$1');
// 方法一:
use App\Controllers\Pages;
$routes->get('pages', [Pages::class, 'index']);
$routes->get('(:segment)', [Pages::class, 'view']);
// 方法二:
$routes->get('pages', 'Pages::index');
$routes->get('(:segment)', 'Pages::view/$1');