• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Having problems putting PHP into a page

Matthew Hawley

Well-known member
#1
This is the html I put in the page
Code:
<div class="baseHtml messageText">
{xen:raw $cssMinify}
</div>
This is my PHP file in /library/XenForo/Pages/CSSMinifier.php
Code:
<?php

class XenForo_Pages_CSSMinifier

{

    public static function includeFile(XenForo_ControllerPublic_Abstract  $controller, XenForo_ControllerResponse_Abstract &$response)

    {

        ob_start();

        require('/forums/CSSMinifier/gui/index.php');

        $myContent = ob_get_contents();

        ob_end_clean();

        $params = array(

            'myContent'  => $cssMinify

        );

        $response->params = array_merge(

            $response->params,

            $params

        );

    }

}
All I'm getting is a blank page. Any suggestions?
 
Last edited:

0xym0r0n

Well-known member
#2
is debug mode on? I would like to think the callback is wrong on your page node, but you'd have got an error on the admin end when trying to save. I haven't done this in a while. You should try using routes now. I think it's within your capabilities to go outside of pages. If you need help with that give me a PM and I'll try to walk you through.
 

Matthew Hawley

Well-known member
#3
is debug mode on? I would like to think the callback is wrong on your page node, but you'd have got an error on the admin end when trying to save. I haven't done this in a while. You should try using routes now. I think it's within your capabilities to go outside of pages. If you need help with that give me a PM and I'll try to walk you through.
Yes debug mode is on.