![]() Topic awaiting preservation: Direct link to stylesheets help please |
|
|---|---|
| Author | Thread |
|
Bipolar (III) Inmate From: |
posted 06-21-2009 00:19
Im trying to link to my style sheets from the root of my drive so that i can put the same dynamic link on every page no matter where the page is located on my site code: define('STYLE_PATH', "C:\wamp\www\digiblueprint\public\stylesheets\main.css");
$page_title = "Testing Layout Function";
$stylesheet = "main.css";
public static function page_header($page_title="", $stylesheet="") {
$style_path = STYLE_PATH;
$output = "<html>\n";
$output .= "<head>\n";
$output .= "<title>". $page_title ."</title>\n";
$output .= "<link href=\"". $style_path ."\" media=\"all\" rel=\"stylesheet\" type=\"text/css\" />\n";
$output .= "</head>\n";
$output .= "<body>\n";
$output .= "<div id=\"header\">\n";
$output .= "<h1>". $page_title ."</h1>\n";
$output .= "</div>\n";
$output .= "<div id=\"main\">\n";
echo $output;
}
code: $output .= "<link href=\"". STYLE_PATH.DS.$stylesheet ."\" media=\"all\" rel=\"stylesheet\" type=\"text/css\" />\n";
code: <?php require_once("includes/initialize.php"); ?>
<?php
$page_title = "Testing Layout Function";
$stylesheet = "main.css";
?>
<?php Layout::page_header($page_title, $stylesheet); ?>
<?php
echo "<div><p>This is a test page for layout.</p></div>";
?>
<?php Layout::page_footer(); ?>
|
|
Paranoid (IV) Inmate From: Florida |
posted 06-21-2009 04:09
That's some pretty awful mixing of code, and where's your doctype declaration? code: <link href="/public/stylesheets/main.css" rel="stylesheet"> |