Jump to content
thirty bees forum

Recommended Posts

Posted

Dear, I am try to override the RenderView() function from adminOrdersController, without copy all function. I am try to add only some tplviewvars, but dont have success, i think is a little detail but don't find it. Have any idea?

public function renderView() { parent::renderView(); $extra_var = [ 'dados_comment_order' => 5555, 'dados_garantia' => 'asdfasf' ]; array_push($this->tpl_view_vars, $extra_var); return parent::renderView(); }

Posted

Solved!

``` public function initContent(){ parent::initContent(); }

public function renderView()
{
    parent::renderView();
    $this->tpl_view_vars['dados_garantia'] = '654654654';
    return AdminController::renderView();
}

```

Posted

Glad to see you got it solved!

public function initContent(){ parent::initContent(); } This should be a no-op. You can remove it entirely without a change in behavior.

public function renderView() { parent::renderView(); $this->tpl_view_vars['dados_garantia'] = '654654654'; return AdminController::renderView(); } Here you call renderView() twice. This should be faster and give the same results: ``` public function renderView() { $this->tplviewvars['dados_garantia'] = '654654654';

    return parent::renderView();
}

```

Posted

@wakabayashi not work if i use the @Traumflug suggestion. I need use all public function renderView() { parent::renderView(); $this->tpl_view_vars['dados_garantia'] = '654654654'; return AdminController::renderView(); }

Posted

doesn’t the $this->tplviewvars just get overriden, when you call parent::renderView()?

That's apparently the case. Overridden by the class between the override and AdminController.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...