Could you tell me how can I create SEO URL as opencart by use CController::forward()?
Here my example.
class ProductController extends Controller
{
public function actionShow($id){
......
$product = Product::model()->find(....);
render('show', array('product' => $product));
}
}
class Controller extends CController
{
public function BeforeAction($action){
$action = Product::model()->find('slug=:s', array(':s' => 'this-is-seo-url-product'));
if($action){
$this->forward('product/show', array('id' => $action->id))
}else{
parent::BeforeAction($action);
}
}
}
My problem is a loop at beforeAction() and it cannot forward to action of controller I want.
Please take a minute to help me!
Thank you so much!