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

Creating a new page, exception / php errors... maybe a stupid mistake on my part.

Discussion in 'XenForo Development Discussions' started by Facepalmx2, Oct 6, 2010.

  1. Facepalmx2

    Facepalmx2 Active Member

    Hey guys.. I feel stupid for having to ask why this is happening, but this is a learning experience. A change from easy development to slightly more advanced. :p

    I receive the following error (along with it's stacktrace):
    An exception occurred: Argument 1 passed to XenForo_Controller::__construct() must be an instance of Zend_Controller_Request_Http, instance of XenForo_ViewRenderer_HtmlPublic given, called in /path/to/my/home/community/library/XenForo/ViewRenderer/Abstract.php on line 200 and defined in /path/to/my/home/community/library/XenForo/Controller.php on line 81

    XenForo_Application::handlePhpError() in XenForo/Controller.php at line 81
    XenForo_Controller->__construct() in XenForo/ViewRenderer/Abstract.php at line 200
    XenForo_ViewRenderer_Abstract->renderViewObject() in XenForo/ViewRenderer/HtmlPublic.php at line 69
    XenForo_ViewRenderer_HtmlPublic->renderView() in XenForo/FrontController.php at line 520
    XenForo_FrontController->renderView() in XenForo/FrontController.php at line 156
    XenForo_FrontController->run() in /path/to/my/home/community/index.php at line 15

    Here's my code for ezirc/Route/Prefix/Index.php

    class ezirc_Route_Prefix_Index implements XenForo_Route_Interface
        public function 
    match($routePathZend_Controller_Request_Http $requestXenForo_Router $router)
    Obviously, there's not much.. there's just something that isn't working right here...
    If someone could help, I would greatly appreciate it :)
    If you need more information, just let me know, I just want to be able to start making stuff work haha.
  2. Mythotical

    Mythotical Well-Known Member

    Did you input the route prefix through the ACP? Try accessing it as /Ezirc/ instead of /ezirc/. If you have the route prefix added, make sure your /xxx/ matches the prefix you entered when adding it through the ACP.
  3. Facepalmx2

    Facepalmx2 Active Member

    Yes, I have a route prefix, configured as follows:
    Prefix: ezirc
    Type: Public
    Class: ezirc_Route_Prefix_Index
    Link: Data only
    Add-on: EzIRC for xenForo
    Trying /Ezirc/ or /EzIRC/ simply returned an undefined action request.

    Is the third parameter to $router->getRouteMatch() supposed to be the template name of which template you wish to load? (just checking)
  4. Mike

    Mike XenForo Developer Staff Member

    This is an issue with the view rendering - you're referring to a controller class instead of a view class when you're returning a responseView() from your controller.
    Facepalmx2 likes this.
  5. Facepalmx2

    Facepalmx2 Active Member

    Thank you! I wouldn't have thought of that with the lack of sleep I've had for so many days..haha.
    Working now...time to finish my product's frontend and release a beta. :p
  6. Mythotical

    Mythotical Well-Known Member

    I didn't even notice. *hides*

Share This Page