• 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.

Facepalmx2

Active member
#1
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

PHP:
<?php
class ezirc_Route_Prefix_Index implements XenForo_Route_Interface
{
	public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
	{
		return $router->getRouteMatch('ezirc_Public_Index', $routePath, 'ezirc_main');
	}
}
?>
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.
 

Mythotical

Well-known member
#2
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.
 

Facepalmx2

Active member
#3
Yes, I have a route prefix, configured as follows:
Code:
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)
 

Mike

XenForo developer
Staff member
#4
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

Active member
#5
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.
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