Problem with this Controller Public file

Matthew Hawley

Well-known member
So I have this file:
Code:
<?php

class MinifyCSS_ControllerPublic_Stuff extends XenForo_ControllerPublic_Abstract
{
   public function actionIndex()
   {
  $contents= file_get_contents('/forums/CSSMinifier/gui/index.php');
  $myContent = $contents;
     $viewParams = array(
       'myContent' => $myContent
    
     );

     return $this->responseView('MinifyCSS_ViewPublic_StuffRendered', 'css_minfier, $viewParams);
   }


}

And I get this error on the page /forums/index.php?MinifyCSS
Code:
Parse error: syntax error, unexpected T_VARIABLE in /home3/mcwh/public_html/xxx/forums/library/MinifyCSS/ControllerPublic/Stuff.php on line 14

Line 14 is
Code:
return $this->responseView('MinifyCSS_ViewPublic_StuffRendered', 'css_minifier, $viewParams);
 
Okay fixed that lol. I didnt have a ' after css_minifier

Now I'm on the page, but I get this error
Code:
file_get_contents(/forums/CSSMinifier/gui/index.php) [function.file-get-contents]: failed to open stream: No such file or directory

XenForo_Application::handlePhpError()
file_get_contents() in MinifyCSS/ControllerPublic/Stuff.php at line 7
MinifyCSS_ControllerPublic_Stuff->actionIndex() in XenForo/FrontController.php at line 337
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
XenForo_FrontController->run() in /home3/mcwh/public_html/xxx/forums/index.php at line 13

Any suggestions? Thanks!

EDIT: fixed it, wrong URL in the code
 
Last edited:
Code:
return $this->responseView('MinifyCSS_ViewPublic_StuffRendered', 'css_minifier, $viewParams);
Should be:
Code:
return $this->responseView('MinifyCSS_ViewPublic_StuffRendered', 'css_minifier', $viewParams);
 
Top Bottom