My application displays articles from content that is stored in a database table.
The article in turn is entered by the admin user using a WYSIWYG widget. When editing the article, an image can be inserted inti the wysiwyg field by entering a URL.
This works fine, but is not a flexible option :-
-
The url changes from dev to staging to production servers
-
The url changes for different themes
I suppose the best option might be to use something like
<img src="<?php echo Yii::app()->theme->baseUrl; ?>/images/myimage.png">
but this will involve either changing the WYSIWYG code, or parsing the stored html code, both of whicj I am trying to avoid.
what is the best option to handle this?