1. 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?

Discussion in 'XenForo Development Discussions' started by Jaxel, Jul 12, 2011.

  1. Jaxel

    Jaxel Well-Known Member

    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:
     

Share This Page