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

wrong inherit

from what class inherit a class
I inherit from a class forum
but comes Null

class  MyClass_ForumMyclass_ControllerPublic_MyIndex extends XFCP_MyClass_ForumMyclass_ControllerPublic_MyIndex

    public function actionIndex()
        $parent =parent::actionIndex();

                 ////my code
                 $viewParams = array(
                    'monster' => $monster,
                $parent->params += $viewParams;
              return $parent;



Then insert into a template forum_list where I want to show off your property
{xen:helper dump,$monster}

and I receive Null

If you insert a different location, the property is shown
but I should like the picture


Well-known member
'monster' => $monster
With this line you define a view paramater with the name „monster“ and the value $monster. However, as you did not assign any value to $monster, the dump shows just null. There should also be an error log entry „Undefined variable: monster“ for each load of the forum index. Btw, if you turn on the XF debug mode you will see the error message immediately instead of the forum index.

So to test your modification you can change the line to e.g.
'monster' => 'I am a monster'
Last edited: