We can get the controller object by the expression $this->context
. And as a result, it is possible to access any properties or methods of the controller in the view, such as the controller ID shown in the following:
The controller ID is: <?= $this->context->id ?>