RE: How can I?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I think you're over-thinking this one or maybe doing it the hard way.

If everything in a particular folder is always going to have the same
theme, then just put the stylesheet in that folder and references it in
the HTML you output.

"localstyle.css"

Something like that.

If you want to be able to have 'themes', then dynically alter the
filename vial PHP:


"$themename-localstyle.css"


You could do the same thing with getting the directory name and using
that like you'd use a $themename.

Anyway, that's what I'd do instead of worrying about switch statements
and all.

Would that work for what you're trying to do?

-TG

> -----Original Message-----
> From: Tony Devlin [mailto:tdevlin@xxxxxxxxxxxxx] 
> Sent: Monday, November 22, 2004 11:20 AM
> To: Php-Windows
> Subject: RE:  How can I?
> 
> 
> The reasoning for this is so that I can apply different 
> stylesheets and
> formatting to different pages inside a specific site.  The 
> entire site is
> dynamic and changeable, they can add pages/subtract pages, 
> etc.. so the
> layout information needs to be controlled on the header page, the only
> static/untouchable page.
> 
> Let's say everything in compayn folder is blue text, but I 
> want everything
> in the customer folder to be green text.  How do you control 
> that when you
> have dynamic pages? .. easy you find a way to establish what 
> your path is,
> check it against known paths, if it exists use a certain 
> stylesheet.  There
> may be an easier way to do this than switches, but I have yet 
> to find one.
> 
> Tony
> 
> 
> -----Original Message-----
> From: Gryffyn, Trevor [mailto:TGryffyn@xxxxxxxxxxxxxxxxx]
> Sent: Monday, November 22, 2004 11:11 AM
> To: Php-Windows
> Cc: tdevlin@xxxxxxxxxxxxx
> Subject: RE:  How can I?
> 
> 
> I'm not quite sure what you're asking for here, but let me 
> take a shot:
> 
> Do you want the scripts in, say, your index.php's to know what folder
> they're in and act accordingly?
> 
> So you'd essentially have exactly the same index.php in every folder,
> but they would do different things depending on if they were in
> /company/ or in /customer/ or in /tips/?
> 
> If so, you could get the SCRIPT_NAME from the server 
> variables, then use
> the dirname() function and some parsing to get the last directory name
> in the path.  But that seems to lead to the "too many SWITCH 
> statements"
> thing that you're trying to avoid.
> 
> Maybe if you could clarify what you're trying to do, it might help us
> determine the best course of action.
> 
> -TG
> 
> > -----Original Message-----
> > From: Tony Devlin [mailto:tdevlin@xxxxxxxxxxxxx] 
> > Sent: Monday, November 22, 2004 9:20 AM
> > 
> > Onto the real question.  I'm trying to make a switch 
> > statement that switches a header file based upon
> > what folder you are in...
> > 
> > An example:
> > 
> > Let's say I have 3 folders with some files inside.
> > 
> > /company/
> >  --> index.php
> >  --> contact.php
> > 
> > /customer/
> >  --> index.php
> >  --> profile.php
> > 
> > /tips/
> >  --> index.php
> > 
> > 
> > Basically instead of building a huge switch with EVERY full 
> > path file name included,  I want to just make a switch based
> > on folder, then every file inside that folder will have
> > the switch applied to it.  I am sure this is
> > possible, anyone have any ideas about how to do this?
> > 
> > Greatly appreciated,
> > 
> > Tony Devlin
> > 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux