Jump to content
thirty bees forum

Override RenderView()


mauroagr

Recommended Posts

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(); }

Link to comment
Share on other sites

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();
}

```

Link to comment
Share on other sites

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