我的路线不起作用,所以我无法访问产品页面
my routes dont work so i cant acces a product page
我遇到了新的障碍。
我确实为特定 "Product" 页面创建了路由,但没有用。
这是我的路线代码
$app->get('/products{slug}',['Cart\Controllers\ProductController','get'])->setName('product.get');
我的 .htaccess 代码是
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]
当我访问页面“localhost/cart/products/am1”时,它显示找不到页面
您可以使用此代码显示单品
$app->get('/products/{slug}', "ProductController@getSingleProduct");
take cake 参数 slug 前有“/”
我遇到了新的障碍。 我确实为特定 "Product" 页面创建了路由,但没有用。
这是我的路线代码
$app->get('/products{slug}',['Cart\Controllers\ProductController','get'])->setName('product.get');
我的 .htaccess 代码是
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]
当我访问页面“localhost/cart/products/am1”时,它显示找不到页面
您可以使用此代码显示单品
$app->get('/products/{slug}', "ProductController@getSingleProduct");
take cake 参数 slug 前有“/”