If you have read this wiki you would be aware of the yii2-detail-view extension and how it offers you an easy way to EDIT and VIEW your model data, toggle these modes, and other features. You can read the extension documentation and/or view a demo of this extension, to understand usage.
Awhile ago I was trying to find a database driven CMenu system to add to my web applications. This always seemed to me that it would be a lot easier to manage if it where in a database. So the following is the results of that effort:
This wiki shows how to get the geolocation info of the client using another server API
It could be write also as extension but there are a lots of APIs that change the below code
So, I wrote the below code that works for one of them (using www.geoplugin.net)