Skip to content
View in the app

A better way to browse. Learn more.

thirty bees forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Override RenderView()

Featured Replies

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

  • Author

Solved!

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

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

```

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

```

  • Author

@traumflug said in Override RenderView():

public function renderView() { $this->tplviewvars['dados_garantia'] = '654654654';

    return parent::renderView();
}

I try here and don't work. I dont know why. Only work with my solution.

  • Author

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

@mauroagr Ah yeah I think I see the problem:

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

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.