34k+
News
Guide
API
Wiki
Forum
Community
Places
Members
Hall of Fame
Badges
More
Learn
Books
Resources
Develop
Download Yii
Extensions
Report an Issue
Report a Security Issue
Contribute to Yii
Donate
About
Release Cycle
License
Team
Official Logos and Design
Login
How to get SEO friendly URL using Model and new getUrl() function
Comparing
#1
with
#2
Revision #2 was created by
shiv
on Sep 21, 2017, 4:25:33 AM.
Improve
« Previous (#1)
Content
[...]
// 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.
[...]