access controller in view

this is my controller

<?php
namespace App\Controllers\Admin;

class SettingAccessController extends ControllerBase
{
  public function indexAction() 
  {
        //something
  }

  pubic function check($param1, $param2)
  {
          if (something) {
              return true;
          }
          return false
  }
}

and I want use "check" method in my view ? I have tried this way. but I get error

Macro 'check' does not exist

    {% if check(param1, param2) %}
        //do something
    {% endif %}

how to make method can access in view ?

edited Apr '16

You have two options:

1) in your current controller method you create a variable and call the check method:

  public function indexAction() 
  {
        $this->view->variable = $this->check();
  }

And in volt:

{% if variable %}

{% endif %}

2) The better solution is to create custom volt function. More info here: https://docs.phalconphp.com/en/latest/reference/volt.html#extending-volt