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

How do you extend view classes?

Jaxel

Well-known member
#1
I have this listener:
Code:
<?php

class EWRporta_Listener_View
{
    public static function forumList($class, array &$extend)
    {
        if ($class == 'XenForo_ViewPublic_Forum_List')
        {
            $extend[] = 'EWRporta_ViewPublic_ForumList';
        }
    }
}
Code:
<?php

class EWRporta_ViewPublic_ForumList extends XFCP_EWRporta_ViewPublic_ForumList
{
    public function renderHtml()
    {
        $response = parent::renderHtml();
        return $response;
    }
}
As you can see, right now it doesn't do anything. However, when I enable the listener, instead of running properly, I get the following error:

Template Errors: PAGE_CONTAINER
  1. Object of class stdClass could not be converted to string in /public_html/library/XenForo/Template/Abstract.php(262) : eval()'d code, line 712:
    711: <!-- main template -->
    712: ' . $contents . '
    713: