it would be nice to have things in one directory, but this works as well. i use the following structure for my site skins, which each have a directory in the public directory:
/public/skins/skin name
./scripts
./styles
./images
then i use this view helper:
PHP Code:
public function RenderSkinStyles($skin){
$view = Zend_Registry::get('view');
$config = Zend_Registry::get('config');
//get the style sheets
$d = new libMedia();
$path = 'public/skins/' . $skin . '/css';
$files = $d->getFiles($path);
//add the master file
$sheets[] = '/' . $config->baseUrl .'/public/styles/public.css';
foreach ($files as $style){
$sheets[] = '/' . $config->baseUrl . '/' . $path . '/' . $style->name;
}
return $view->StyleSheets($sheets, false);
}
libMedia->getFiles :
PHP Code:
/**
* if you send a path it will set the path to that path
* returns the current directories files
* returns the absolute url as the path
*
*/
function getFiles($path = false)
{
if(!$path){$path = $this->path;}
if (is_dir($path)) {
$path = './' . $path . '/';
if ($dh = opendir($path)) {
while (($file = readdir($dh)) !== false) {
if(is_file($path . $file)){
$x = new stdClass();
$x->name = $file;
$x->path = $path;
$files[] = $x;
}
}
closedir($dh);
}
}
return $files;
}
the same goes for the scripts. some variation of this aproach may work for you.