Difference between #1 and #2 of
How to get SEO friendly URL using Model and new getUrl() function

Changes

Title unchanged

How to get SEO friendly URL using Model and new getUrl() function

Category unchanged

How-tos

Yii version unchanged

Tags unchanged

beautiful url

Content changed

[...]
// absolute url
return Yii::$app->getUrlManager ()->createAbsoluteUrl ( $params, true );
}
```

In code code where ever you need to url to a model , you just call **$model->url** or **$model->getUrl(
'view')**.

You may have to additionally update urlManager in config with rules for pretty url.
[...]
2 0
1 follower
Viewed: 27 113 times
Version: 2.0
Category: How-tos
Written by: shiv
Last updated by: shiv
Created on: Sep 21, 2017
Last updated: 7 years ago
Update Article

Revisions

View all history