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

inheritance class

Discussion in 'XenForo Development Discussions' started by Hugilore111, May 8, 2016.

  1. Hugilore111

    Hugilore111 Member

    Hello everybody
    I inherit a class, but when the transmission parameter from the parent to the child class is not transmitted properly.
    I should like to convey the image in the template account_personal_details
    but it is transferred to another template account_vrapper
    give me advice.

    Code:
    <?php
    class MyAddon_ControllerPublic_Account extends XFCP_MyAddon_ControllerPublic_Account
    {
        public function actionPersonalDetails()
        {
           
            $response = parent::actionPersonalDetails();
    
           $response->params['myArray'] = 'myArray';
    
           
            return $response;
           
    }
    }
    wrapper.jpg
     
  2. Liam W

    Liam W Well-Known Member

    You have to modify the subView. The account controllers use a wrapper, with the 'actual' view in the subView.

    Use:

    PHP:
    <?php

    class MyAddon_ControllerPublic_Account extends XFCP_MyAddon_ControllerPublic_Account
    {
        public function 
    actionPersonalDetails()
        {
          
            
    $response parent::actionPersonalDetails();

            
    $response->subView->params['myArray'] = 'myArray';

          
            return 
    $response;
           }
    }
    Liam
     
    Hugilore111 likes this.

Share This Page