When building PHP web applications you usually have to take care about defining and providing a consistent development and production environment for your team. This includes your application packages, PHP-extensions, database servers and often further components such as a mail server or workers.
I found a standard Yii app's protected folder structure nearly perfect. With a few simple moves and a little bit change to the code, I managed to bring it to the level, which I found as fully perfect. I want to share my point of view, in case someone would like to use this structure as well.
In a nutshell, the task at hand is to mark (or render) a model attribute in the typical "_form.php" view file with the 'required' red asterisk while this attribute is not marked as required in the model's rule() method.
If you're interested only in the solution, jump ahead to the 'solution' section below.
Many applications wish to obtain parts of the URL for the current page (the hostname, the query string, etc.), and the CHttpRequest class wraps various $_SERVER variables to break down the URL into its constituent parts.