Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 05-14-2007, 11:23 PM
Junior Member
 
Join Date: May 2007
Posts: 25
Default another approach

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($sheetsfalse);
    } 
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:30 AM.