This is the API docs for LemonStand V1, which has been discontinued. LemonStand is now a cloud based platform, available at lemonstand.com.

LemonStand API

backend:onBeforeRenderPage event

Triggered by Backend_Controller
Author LemonStand eCommerce Inc.

Event handler signature

public void event_onBeforeRenderPage(Backend_Controller $controller, string $view_path)
$controller Backend_Controller specifies the Administration Area controller object.
$view_path string specifies a path to the page's view document.
Triggered before an Administration Area page is rendered. In the event handler you can inject new variables to the view document.
public function subscribeEvents()
{
  Backend::$events->addEvent('backend:onBeforeRenderPage', $this, 'backend_render_page');
}

public function backend_render_page($controller, $view)
{
  if ($controller instanceof Shop_Orders and basename($view) == 'create')
  {
    Phpr::$session->flash['error'] = 'We are sorry, you cannot create new orders in the Demo store.';
    $controller->viewData['fatalError'] = true;
  }
}