Output rendering issue

149 views
Skip to first unread message

phpfan

unread,
Nov 15, 2011, 8:20:37 AM11/15/11
to PHP Savant
Hey guys..
I'm using PHP 5.3.5 and the latest savant3.

I'm having an issue:
My css file is not rendered. If I put the css inline inside the same
template, it works, but if I linked like:
<link href="/css/style.css" rel="stylesheet" type="text/css"
media="screen, projection"/>

it does not work.

BUT strangely, if I put an echo or print before the code $tpl-
>display('test.tpl.php');
the CSS is now rendered correctly.
Example:
echo "&nbsp;";
$tpl->display('test.tpl.php'); //now css rendered ok

I'm guessing it's an output buffering issue, but I cannot figure out
what exactly the problem is. Can anyone help please?
I have already spent half a day on this with no luck :(


The code behind is very simple:
------------------------------
require_once '_includes/lib/vendors/Savant/Savant3.php';
$savant_config = array('template_path' => TPL);
$tpl = new \Savant\Savant3($savant_config);
//echo "&nbsp;";
$tpl->display('test.tpl.php');
------------------------------

And the HTML template is also a simple one.
It sucks to not see simple things work correctly.

Thanks!

phpfan

unread,
Nov 16, 2011, 6:44:42 AM11/16/11
to PHP Savant
please anyone?

Brett Bieber

unread,
Nov 16, 2011, 10:14:40 AM11/16/11
to phps...@googlegroups.com

Do you have error reporting turned on..? I'm curious if there's an
error elsewhere that is causing you trouble.

Could you supply links to the individual files, perhaps some place
like gist.github.com so we can see exactly what you're talking about?

--
Brett Bieber

Message has been deleted
Message has been deleted
Message has been deleted

phpfan

unread,
Nov 17, 2011, 7:23:57 AM11/17/11
to PHP Savant
To my dismay, I found out it's my .htaccess which is the culprit..
Nothing to do with php or savant.

Sorry for the trouble.
Regards!




Nov 17, 3:03 pm, phpfan <wk.d...@gmail.com> wrote:
> Hi Brett,
>
> Actually I'm using Savant inside my own made framework, I code from
> scratch and I have my own autoloading, templating, db layer..etc
> I also add CSS files dynamically. I'm actually having the issue here.
> The css is not being rendered although I can see it when I view source
> from browser.
>
> But I have tried simplifying everything, just to test the template,
> now it works. I think I will have to remove module by module and find
> out the culprit.
> I will post back as and when I see things.
>
> Regards!
>
> On Nov 16, 7:14 pm, Brett Bieber <brett.bie...@gmail.com> wrote:

phpfan

unread,
Nov 17, 2011, 7:56:41 AM11/17/11
to PHP Savant
The exact culprit was the line ForceType application/x-httpd-php in
my .htaccess
Hope it can be a hint for anyone might run throught a similar issue.

Cheers!
Reply all
Reply to author
Forward
0 new messages