You are here: Re: Dynamically assigning a CSS file to a TPL file « PHP Programming Language « IT news, forums, messages
Re: Dynamically assigning a CSS file to a TPL file

Posted by Jerry Stuckle on 11/02/06 04:59

Cookie Jar wrote:
> I have a situation where I am trying to abstract away not only the
> organization of the presentation (via TPL files) but also some of the
> finer formatting features (via CSS).
>
> So, for a particular request, I want to be able to select a specific
> TPL file to render (easy enough), but I also want to indicate a
> specific CSS file to use with the selected TPL.
>
> Can this assignment be done dynamically, i.e. at runtime? I am hoping
> I can pass the name of the CSS file to the TPL file, as any other
> dynamically assigned tag, but I am unsure whether the TPL file would be
> compiled before or after the CSS file would be assigned.
>


Not that bad. In your header, just add:

<link href="<?php echo $cssfile; ?>" rel="stylesheet" type="text/css">

Where $cssfile is the name of the css filename you wish to use.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация