How to configure the routing to view ads?

Hello! Here's the thing: there is a page that displays ads. When you click on the ad go to view it. Each ad your id in the database. You need to when you click on the link localhost/message/XXXX (XXX is the id of the announcement) called the method actionAdvertView, and it is to this same id to get the ad from the database. How to do that?
June 3rd 19 at 19:29
1 answer
June 3rd 19 at 19:31
Solution
if correctly understood, then Your problem can be solved by adding the following rule in URL Manager:
'message/<id:\d+>' => 'message/advert-view'</id:\d+>
Thank you! How to get id in controller? - Kavon.Herzog27 commented on June 3rd 19 at 19:34
as regular get-parameter using the request object - bryana.Renn commented on June 3rd 19 at 19:37
thank you! - Kavon.Herzog27 commented on June 3rd 19 at 19:40

Find more questions by tags Yii