Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

fTemplating CSS Url

posted by dberry 8 years ago

I am using the fTemplating/minification. The problem I am having is that the end result of the place is just giving the path of /assets/css/example.css, which works great if the requested page is in my doc root. But for example if the page is at www.mydomain.com/user/me, it gives the css a path of /user/me/assets....

How can I specify an absolute path rather than relative? example i would like it to be http://www.mydomain.com/assets/css/example.css

Here is my code...

$template = new fTemplating('assets/');
$template->enableMinification('development', 'assets/cache/');

// add css to be minified
$template->add('css' , '/assets/css/1140.css');
$template->add('css' , '/assets/css/formalize.css');
$template->add('css' , '/assets/css/combined.css');

and using place to stick it into my template:

<!-- CSS: implied media="all" -->
<?php $template->place('css') ?>

I believe changing the cache directory to an absolute filesystem path should fix it for you.

$template->enableMinification('development', $_SERVER['DOCUMENT_ROOT'] . '/assets/cache/');
posted by wbond 8 years ago

That fixed it... Thank you, and there aren't enough awesome ways to describe your work on Flourish and the time you take to individually answer questions.

posted by dberry 8 years ago