How to choose the layout of the site according to the username in yii2
<p>I have a project where the user chooses the layout, and saves it in the database, how do I choose to change this layout in real time?</p>

<p>For example; <a href="http://www.example.com/" rel="nofollow noreferrer">http://www.example.com/</a><strong>username</strong>/controller/action/id</p>

<p>Throughout the site I would have with the first parameter the <strong>username</strong>, which is actually where the system will know which layout it chose.</p>

<p>Can anybody help me?</p>

<p><strong>EDITED</strong></p>

<p>For example; When the user accesses the site I pass the following link: www.example.com/index.php?<strong>layout=4545455</strong>, so I would be able to know which layout to use, but how do I keep this  parameter <strong>layout=4545455</strong> on all routes Site? Well if I click on the about menu it will be with the url www.example.com/index.php?r=site/about</p>