<?php

namespace {{ appNamespace }}\Controllers;

class {{ controller }} extends \Hubleto\Erp\Controller
{

  // Uncomment this if you want to make your controller publicly
  // available without need for authentication.
  // public bool $requiresAuthenticatedUser = false;

  // Uncomment this if you want to have full control over the response content
  // (default Hubleto's desktop will not be rendered)
  // public bool $hideDefaultDesktop = true;

  /**
   * Returns parameters for the view to be rendered, as well as the
   * path to the view. For more information about controllers see
   * https://developer.hubleto.eu/v0/docs/controllers
   *
   * @return void
   * 
   */
  public function prepareView(): void
  {

    // Uncomment this to fire an event
    // For more details see http://localhost/hubleto/developer/v0/docs/events
    // $this->eventManager()->fire('onControllerBeforePrepareView', [$this]);

    parent::prepareView();

    // Following are sample view parameters generated by
    // the `php hubleto` command. Feel free to modify it.
    // For more details see https://developer.hubleto.eu/docs/views,
    // https://developer.hubleto.eu/docs/ui, or
    // https://developer.hubleto.eu/advanced-development/customizing-ui

    $this->viewParams['now'] = date('Y-m-d H:i:s');
    $this->viewParams['randomNumber'] = rand(1, 1000);

    $this->setView('@{{ appViewNamespace }}/{{ controller }}.twig');

    // Uncomment this to fire an event
    // For more details see http://developer.hubleto.eu/docs/events
    // $this->eventManager()->fire('onControllerAfterPrepareView', [$this]);
  }

}
