The title might be confusing as I'm not sure myself on how to explain this. I'm sure its a pretty simple solution.
I'm moving all my static images,css,js to S3 - so now they can be accessed via
Egs:
http://files.xyz.com/images/logo.gif http://files.xyz.com/images/submit_button.gif http://files.xyz.com/style/style.css http://files.xyz.com/js/jquery.js
files.xyz.com is a CNAME pointing to files.xyz.com.s3.amazonaws.com
Now in my Zend layout and views - I'm accessing these with the full URL egs
<img src="http://files.xyz.com/images/logo.gif"/>
My concern is when I'm testing on localhost - I dont want the data to be fetched from S3 but from my local hard disk
So I want to do something like this. In my application.ini - I should be able to specify
resources.frontController.imageUrl = http://localhost
And when I'm deploying - simply change that to
resources.frontController.imageUrl = http://files.xyz.com
And access it in the view like <img src="<?php echo $this->imageUrl;?>/images/logo.gif"/>
What is the best approach to handling this Thanks
Create a view helper
In appilication.ini
You can call like this
So you can enable/disable the s3 easily.