generate URLs in php to get proper Yii URL format, fixes #1