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

Problem with this Controller Public file

Discussion in 'XenForo Development Discussions' started by Matthew Hawley, Dec 6, 2013.

  1. Matthew Hawley

    Matthew Hawley Well-Known Member

    So I have this file:
    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
    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
    return $this->responseView('MinifyCSS_ViewPublic_StuffRendered', 'css_minifier, $viewParams);
  2. Matthew Hawley

    Matthew Hawley Well-Known Member

    Okay fixed that lol. I didnt have a ' after css_minifier

    Now I'm on the page, but I get this error
    file_get_contents(/forums/CSSMinifier/gui/index.php) [function.file-get-contents]: failed to open stream: No such file or directory
    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: Dec 6, 2013
  3. Nobita.Kun

    Nobita.Kun Well-Known Member

    return $this->responseView('MinifyCSS_ViewPublic_StuffRendered', 'css_minifier, $viewParams);
    Should be:
    return $this->responseView('MinifyCSS_ViewPublic_StuffRendered', 'css_minifier', $viewParams);

Share This Page