Reputation: 15
I got a new obstacle. I did make a route for a specific "Product" page and dont work.
Here's my routes code
$app->get('/products{slug}',['Cart\Controllers\ProductController','get'])->setName('product.get');
and my .htaccess code is
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]
And when I access the page " localhost/cart/products/am1" it gets me Page Not Found
Upvotes: 0
Views: 30
Reputation: 36
you can use this code to show single product
$app->get('/products/{slug}', "ProductController@getSingleProduct");
take cake there is "/" before parameter slug
Upvotes: 1