views:

55

answers:

3

I guess these are all questions that everyone must just know, because I'm not seeing this in the documentation :-D

I understand that the public folder is the folder that the world has access to.

I know it is the case with the css folder, but in migrating a traditional php website over, will my /images folder, /js folder /mp3s, etc Will those all just also be public folders that will be accessed via the layout or view.phtml pages?

Thanks!

+1  A: 

Yep, I believe so. That directory is the primary front-end for Apache - as dictated by your .conf settings. Index.php handles your index actions and everything else (that exists) in that directory (or below) will be referenced directly by Apache as a static file.

[ed. I'm assuming Apache as a representative of the web server world.]

Inkspeak
A: 

If you checkout the rewrite section of the Zend_Controller Quickstart, you'll find:

The above rules will route requests to existing resources (existing symlinks, non-empty files, or non-empty directories) accordingly, and all other requests to the front controller.

That covers your javascript, mp3s, and images.

Tim Lytle
A: 

These .htaccess entries ensure that the requests to your assets are handled directly, not by mod_rewrite:

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d

You just put your files in the base public directory, and then in your view use BaseUrl view helper:

<a href="<?= $this->baseUrl('mp3/ie.mp3'); ?>">IE is mean to me, again</a>

If you need to place the files somewhere else, you may use setBaseUrl().

takeshin